diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9bd9738..588f01f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -56,8 +56,8 @@ jobs: push: true platforms: linux/amd64,linux/arm64 tags: | - javtube/javtube-server:dev - ghcr.io/javtube/javtube-server:dev + javtube/metatube-server:dev + ghcr.io/javtube/metatube-server:dev cache-from: type=gha cache-to: type=gha,mode=max @@ -70,9 +70,9 @@ jobs: push: true platforms: linux/amd64,linux/arm64 tags: | - javtube/javtube-server:latest - javtube/javtube-server:${{ steps.shell.outputs.version }} - ghcr.io/javtube/javtube-server:latest - ghcr.io/javtube/javtube-server:${{ steps.shell.outputs.version }} + javtube/metatube-server:latest + javtube/metatube-server:${{ steps.shell.outputs.version }} + ghcr.io/javtube/metatube-server:latest + ghcr.io/javtube/metatube-server:${{ steps.shell.outputs.version }} cache-from: type=gha cache-to: type=gha,mode=max diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 03c147c..f8dcdc2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,5 +41,5 @@ jobs: files: build/* draft: false prerelease: false - repository: javtube/javtube-server-releases + repository: javtube/metatube-server-releases token: ${{ secrets.BOT_PAT }} diff --git a/.golangci.yaml b/.golangci.yaml index 2229045..1823d10 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -10,7 +10,7 @@ linters-settings: gci: sections: - standard - - prefix(github.com/javtube/javtube-sdk-go) + - prefix(github.com/javtube/metatube-sdk-go) - default staticcheck: go: '1.19' diff --git a/Dockerfile b/Dockerfile index e56bc49..b10d34d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,9 +7,9 @@ RUN apk add --update --no-cache --no-progress make git \ && make server FROM alpine:latest -LABEL org.opencontainers.image.source="https://github.com/javtube/javtube-sdk-go" +LABEL org.opencontainers.image.source="https://github.com/javtube/metatube-sdk-go" -COPY --from=builder /src/build/javtube-server . +COPY --from=builder /src/build/metatube-server . RUN apk add --update --no-cache --no-progress ca-certificates tzdata @@ -23,4 +23,4 @@ ENV DB_MAX_OPEN_CONNS=0 ENV DB_PREPARED_STMT=0 ENV DB_AUTO_MIGRATE=0 -ENTRYPOINT ["/javtube-server"] +ENTRYPOINT ["/metatube-server"] diff --git a/Makefile b/Makefile index 722369b..c7ba703 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ -MODULE := github.com/javtube/javtube-sdk-go +MODULE := github.com/javtube/metatube-sdk-go -SERVER_NAME := javtube-server +SERVER_NAME := metatube-server SERVER_CODE := cmd/server/main.go BUILD_DIR := build diff --git a/README.md b/README.md index d37878e..de68fa1 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,18 @@ -# JavTube SDK Go +# MetaTube SDK Go -[![Build Status](https://img.shields.io/github/workflow/status/javtube/javtube-sdk-go/Publish%20Go%20Releases?style=flat-square&logo=github-actions)](https://github.com/javtube/javtube-sdk-go/actions/workflows/release.yml) -[![Go Report Card](https://goreportcard.com/badge/github.com/javtube/javtube-sdk-go?style=flat-square)](https://github.com/javtube/javtube-sdk-go) -[![Require Go Version](https://img.shields.io/badge/go-%3E%3D1.19-30dff3?style=flat-square&logo=go)](https://github.com/javtube/javtube-sdk-go/blob/main/go.mod) -[![GitHub License](https://img.shields.io/github/license/javtube/javtube-sdk-go?color=A42E2B&logo=gnu&style=flat-square)](https://github.com/javtube/javtube-sdk-go/blob/main/LICENSE) -[![Tag](https://img.shields.io/github/v/tag/javtube/javtube-sdk-go?color=%23ff8936&logo=fitbit&style=flat-square)](https://github.com/javtube/javtube-sdk-go/tags) +[![Build Status](https://img.shields.io/github/workflow/status/javtube/metatube-sdk-go/Publish%20Go%20Releases?style=flat-square&logo=github-actions)](https://github.com/javtube/metatube-sdk-go/actions/workflows/release.yml) +[![Go Report Card](https://goreportcard.com/badge/github.com/javtube/metatube-sdk-go?style=flat-square)](https://github.com/javtube/metatube-sdk-go) +[![Require Go Version](https://img.shields.io/badge/go-%3E%3D1.19-30dff3?style=flat-square&logo=go)](https://github.com/javtube/metatube-sdk-go/blob/main/go.mod) +[![GitHub License](https://img.shields.io/github/license/javtube/metatube-sdk-go?color=A42E2B&logo=gnu&style=flat-square)](https://github.com/javtube/metatube-sdk-go/blob/main/LICENSE) +[![Tag](https://img.shields.io/github/v/tag/javtube/metatube-sdk-go?color=%23ff8936&logo=fitbit&style=flat-square)](https://github.com/javtube/metatube-sdk-go/tags) -[//]: # ([![Supported Platforms](https://img.shields.io/badge/platform-Linux%20%7C%20FreeBSD%20%7C%20NetBSD%20%7C%20OpenBSD%20%7C%20Darwin%20%7C%20Windows-549688?style=flat-square&logo=launchpad)](https://github.com/javtube/javtube-sdk-go)) +[//]: # ([![Supported Platforms](https://img.shields.io/badge/platform-Linux%20%7C%20FreeBSD%20%7C%20NetBSD%20%7C%20OpenBSD%20%7C%20Darwin%20%7C%20Windows-549688?style=flat-square&logo=launchpad)](https://github.com/javtube/metatube-sdk-go)) -Just Another Video Tube SDK in Golang. +Metadata Tube SDK in Golang. ## Contents -- [JavTube SDK Go](#javtube-sdk-go) +- [MetaTube SDK Go](#metatube-sdk-go) - [Contents](#contents) - [Features](#features) - [Installation](#installation) @@ -50,7 +50,7 @@ Just Another Video Tube SDK in Golang. To install this package, you first need [Go](https://golang.org/) installed (**version 1.19+ is required**), then you can use the below Go command to install SDK. ```sh -go get -u github.com/javtube/javtube-sdk-go +go get -u github.com/javtube/metatube-sdk-go ``` ## Quickstart @@ -67,7 +67,7 @@ import ( "fmt" "log" - "github.com/javtube/javtube-sdk-go/engine" + "github.com/javtube/metatube-sdk-go/engine" ) func main() { @@ -91,7 +91,7 @@ $ go run example.go ## API Examples -You can find detailed examples in [examples folder](https://github.com/javtube/javtube-sdk-go/tree/main/_examples/) or specific implementations in [cmd folder](https://github.com/javtube/javtube-sdk-go/tree/main/cmd/). +You can find detailed examples in [examples folder](https://github.com/javtube/metatube-sdk-go/tree/main/_examples/) or specific implementations in [cmd folder](https://github.com/javtube/metatube-sdk-go/tree/main/cmd/). ### Initiate SDK engine manually @@ -102,8 +102,8 @@ import ( "log" "time" - "github.com/javtube/javtube-sdk-go/database" - "github.com/javtube/javtube-sdk-go/engine" + "github.com/javtube/metatube-sdk-go/database" + "github.com/javtube/metatube-sdk-go/engine" ) func main() { @@ -195,7 +195,7 @@ func main() { package main import ( - "github.com/javtube/javtube-sdk-go/translate" + "github.com/javtube/metatube-sdk-go/translate" ) func main() { @@ -226,4 +226,4 @@ func main() { ## License -[GNU GPLv3 License](https://github.com/javtube/javtube-sdk-go/blob/main/LICENSE) +[GNU GPLv3 License](https://github.com/javtube/metatube-sdk-go/blob/main/LICENSE) diff --git a/_examples/README.md b/_examples/README.md index de8bd77..9e9c65a 100644 --- a/_examples/README.md +++ b/_examples/README.md @@ -1,3 +1,3 @@ # SDK Examples -This folder provides easy to understand code snippets on how to get started with javtube-sdk-go. +This folder provides easy to understand code snippets on how to get started with metatube-sdk-go. diff --git a/_examples/basic/basic.go b/_examples/basic/basic.go index b1b8215..a50b3e5 100644 --- a/_examples/basic/basic.go +++ b/_examples/basic/basic.go @@ -4,7 +4,7 @@ import ( "fmt" "log" - "github.com/javtube/javtube-sdk-go/engine" + "github.com/javtube/metatube-sdk-go/engine" ) func main() { diff --git a/_examples/demo/demo.go b/_examples/demo/demo.go index f101c97..664803f 100644 --- a/_examples/demo/demo.go +++ b/_examples/demo/demo.go @@ -1,12 +1,12 @@ package main import ( - "github.com/javtube/javtube-sdk-go/engine" - "github.com/javtube/javtube-sdk-go/provider/arzon" - "github.com/javtube/javtube-sdk-go/provider/fanza" - "github.com/javtube/javtube-sdk-go/provider/javbus" - "github.com/javtube/javtube-sdk-go/provider/sod" - "github.com/javtube/javtube-sdk-go/provider/xslist" + "github.com/javtube/metatube-sdk-go/engine" + "github.com/javtube/metatube-sdk-go/provider/arzon" + "github.com/javtube/metatube-sdk-go/provider/fanza" + "github.com/javtube/metatube-sdk-go/provider/javbus" + "github.com/javtube/metatube-sdk-go/provider/sod" + "github.com/javtube/metatube-sdk-go/provider/xslist" ) func main() { @@ -50,7 +50,7 @@ func main() { // Get movie primary image id `hmn00268` from FANZA with aspect ratio set to 7:10 and pos set to center. app.GetMoviePrimaryImage(fanza.Name, "hmn00268", 0.70, 0.5) - + // Get movie backdrop image id `DLDSS-077` from SOD. app.GetMovieBackdropImage(sod.Name, "DLDSS-077") } diff --git a/_examples/translate/translate.go b/_examples/translate/translate.go index be9cad0..12d31a5 100644 --- a/_examples/translate/translate.go +++ b/_examples/translate/translate.go @@ -1,7 +1,7 @@ package main import ( - "github.com/javtube/javtube-sdk-go/translate" + "github.com/javtube/metatube-sdk-go/translate" ) func main() { diff --git a/cmd/server/main.go b/cmd/server/main.go index 34df10f..e7d8def 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -12,11 +12,11 @@ import ( "github.com/gin-gonic/gin" "github.com/peterbourgon/ff/v3" - "github.com/javtube/javtube-sdk-go/database" - "github.com/javtube/javtube-sdk-go/engine" - V "github.com/javtube/javtube-sdk-go/internal/version" - "github.com/javtube/javtube-sdk-go/route" - "github.com/javtube/javtube-sdk-go/route/auth" + "github.com/javtube/metatube-sdk-go/database" + "github.com/javtube/metatube-sdk-go/engine" + V "github.com/javtube/metatube-sdk-go/internal/version" + "github.com/javtube/metatube-sdk-go/route" + "github.com/javtube/metatube-sdk-go/route/auth" ) const defaultRequestTimeout = time.Minute diff --git a/common/fetch/fetch.go b/common/fetch/fetch.go index 30046d0..e6d6cd7 100644 --- a/common/fetch/fetch.go +++ b/common/fetch/fetch.go @@ -8,8 +8,8 @@ import ( "github.com/hashicorp/go-retryablehttp" - "github.com/javtube/javtube-sdk-go/common/random" - "github.com/javtube/javtube-sdk-go/errors" + "github.com/javtube/metatube-sdk-go/common/random" + "github.com/javtube/metatube-sdk-go/errors" ) var DefaultFetcher = Default(&Config{RandomUserAgent: true}) diff --git a/common/fetch/option.go b/common/fetch/option.go index d3957f2..1415bfd 100644 --- a/common/fetch/option.go +++ b/common/fetch/option.go @@ -3,7 +3,7 @@ package fetch import ( "net/http" - "github.com/javtube/javtube-sdk-go/common/random" + "github.com/javtube/metatube-sdk-go/common/random" ) // Context is used for each request. diff --git a/common/m3u8/m3u8_test.go b/common/m3u8/m3u8_test.go index 9e860ff..618c248 100644 --- a/common/m3u8/m3u8_test.go +++ b/common/m3u8/m3u8_test.go @@ -3,7 +3,7 @@ package m3u8 import ( "testing" - "github.com/javtube/javtube-sdk-go/common/fetch" + "github.com/javtube/metatube-sdk-go/common/fetch" ) func TestParseBestMediaURI(t *testing.T) { diff --git a/engine/actor.go b/engine/actor.go index 4daec7d..f256196 100644 --- a/engine/actor.go +++ b/engine/actor.go @@ -7,16 +7,16 @@ import ( "gorm.io/gorm/clause" - "github.com/javtube/javtube-sdk-go/common/comparer" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/common/priority" - "github.com/javtube/javtube-sdk-go/engine/internal/utils" - "github.com/javtube/javtube-sdk-go/model" - javtube "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/gfriends" + "github.com/javtube/metatube-sdk-go/common/comparer" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/common/priority" + "github.com/javtube/metatube-sdk-go/engine/internal/utils" + "github.com/javtube/metatube-sdk-go/model" + mt "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/gfriends" ) -func (e *Engine) searchActorFromDB(keyword string, provider javtube.Provider) (results []*model.ActorSearchResult, err error) { +func (e *Engine) searchActorFromDB(keyword string, provider mt.Provider) (results []*model.ActorSearchResult, err error) { var infos []*model.ActorInfo if err = e.db. Where("provider = ? AND name = ? COLLATE NOCASE", @@ -32,12 +32,12 @@ func (e *Engine) searchActorFromDB(keyword string, provider javtube.Provider) (r return } -func (e *Engine) searchActor(keyword string, provider javtube.Provider, fallback bool) ([]*model.ActorSearchResult, error) { +func (e *Engine) searchActor(keyword string, provider mt.Provider, fallback bool) ([]*model.ActorSearchResult, error) { innerSearch := func(keyword string) (results []*model.ActorSearchResult, err error) { if provider.Name() == gfriends.Name { - return provider.(javtube.ActorSearcher).SearchActor(keyword) + return provider.(mt.ActorSearcher).SearchActor(keyword) } - if searcher, ok := provider.(javtube.ActorSearcher); ok { + if searcher, ok := provider.(mt.ActorSearcher); ok { defer func() { if err != nil || len(results) == 0 { return // ignore error or empty. @@ -71,11 +71,11 @@ func (e *Engine) searchActor(keyword string, provider javtube.Provider, fallback return searcher.SearchActor(keyword) } // All providers should implement ActorSearcher interface. - return nil, javtube.ErrInfoNotFound + return nil, mt.ErrInfoNotFound } names := parser.ParseActorNames(keyword) if len(names) == 0 { - return nil, javtube.ErrInvalidKeyword + return nil, mt.ErrInvalidKeyword } var ( results []*model.ActorSearchResult @@ -85,7 +85,7 @@ func (e *Engine) searchActor(keyword string, provider javtube.Provider, fallback innerResults, innerErr := innerSearch(name) if innerErr != nil && // ignore InfoNotFound error. - innerErr != javtube.ErrInfoNotFound { + innerErr != mt.ErrInfoNotFound { // add error to chain and handle it later. errors = append(errors, innerErr) continue @@ -96,7 +96,7 @@ func (e *Engine) searchActor(keyword string, provider javtube.Provider, fallback if len(errors) > 0 { return nil, fmt.Errorf("search errors: %v", errors) } - return nil, javtube.ErrInfoNotFound + return nil, mt.ErrInfoNotFound } return results, nil } @@ -116,7 +116,7 @@ func (e *Engine) SearchActorAll(keyword string, fallback bool) (results []*model ) for _, provider := range e.actorProviders { wg.Add(1) - go func(provider javtube.ActorProvider) { + go func(provider mt.ActorProvider) { defer wg.Done() if innerResults, innerErr := e.searchActor(keyword, provider, fallback); innerErr == nil { for _, result := range innerResults { @@ -138,7 +138,7 @@ func (e *Engine) SearchActorAll(keyword string, fallback bool) (results []*model return } -func (e *Engine) getActorInfoFromDB(provider javtube.ActorProvider, id string) (*model.ActorInfo, error) { +func (e *Engine) getActorInfoFromDB(provider mt.ActorProvider, id string) (*model.ActorInfo, error) { info := &model.ActorInfo{} err := e.db. // Exact match here. Where("provider = ?", provider.Name()). @@ -147,11 +147,11 @@ func (e *Engine) getActorInfoFromDB(provider javtube.ActorProvider, id string) ( return info, err } -func (e *Engine) getActorInfoWithCallback(provider javtube.ActorProvider, id string, lazy bool, callback func() (*model.ActorInfo, error)) (info *model.ActorInfo, err error) { +func (e *Engine) getActorInfoWithCallback(provider mt.ActorProvider, id string, lazy bool, callback func() (*model.ActorInfo, error)) (info *model.ActorInfo, err error) { defer func() { // metadata validation check. if err == nil && (info == nil || !info.Valid()) { - err = javtube.ErrIncompleteMetadata + err = mt.ErrIncompleteMetadata } }() if provider.Name() == gfriends.Name { @@ -183,9 +183,9 @@ func (e *Engine) getActorInfoWithCallback(provider javtube.ActorProvider, id str return callback() } -func (e *Engine) getActorInfoByProviderID(provider javtube.ActorProvider, id string, lazy bool) (*model.ActorInfo, error) { +func (e *Engine) getActorInfoByProviderID(provider mt.ActorProvider, id string, lazy bool) (*model.ActorInfo, error) { if id = provider.NormalizeID(id); id == "" { - return nil, javtube.ErrInvalidID + return nil, mt.ErrInvalidID } return e.getActorInfoWithCallback(provider, id, lazy, func() (*model.ActorInfo, error) { return provider.GetActorInfoByID(id) @@ -200,13 +200,13 @@ func (e *Engine) GetActorInfoByProviderID(name, id string, lazy bool) (*model.Ac return e.getActorInfoByProviderID(provider, id, lazy) } -func (e *Engine) getActorInfoByProviderURL(provider javtube.ActorProvider, rawURL string, lazy bool) (*model.ActorInfo, error) { +func (e *Engine) getActorInfoByProviderURL(provider mt.ActorProvider, rawURL string, lazy bool) (*model.ActorInfo, error) { id, err := provider.ParseIDFromURL(rawURL) switch { case err != nil: return nil, err case id == "": - return nil, javtube.ErrInvalidURL + return nil, mt.ErrInvalidURL } return e.getActorInfoWithCallback(provider, id, lazy, func() (*model.ActorInfo, error) { return provider.GetActorInfoByURL(rawURL) diff --git a/engine/engine.go b/engine/engine.go index ee912d7..b7fd259 100644 --- a/engine/engine.go +++ b/engine/engine.go @@ -8,21 +8,21 @@ import ( "gorm.io/gorm" - "github.com/javtube/javtube-sdk-go/common/fetch" - "github.com/javtube/javtube-sdk-go/database" - "github.com/javtube/javtube-sdk-go/model" - javtube "github.com/javtube/javtube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/common/fetch" + "github.com/javtube/metatube-sdk-go/database" + "github.com/javtube/metatube-sdk-go/model" + mt "github.com/javtube/metatube-sdk-go/provider" ) type Engine struct { db *gorm.DB fetcher *fetch.Fetcher // Name:Provider Map - actorProviders map[string]javtube.ActorProvider - movieProviders map[string]javtube.MovieProvider + actorProviders map[string]mt.ActorProvider + movieProviders map[string]mt.MovieProvider // Host:Providers Map - actorHostProviders map[string][]javtube.ActorProvider - movieHostProviders map[string][]javtube.MovieProvider + actorHostProviders map[string][]mt.ActorProvider + movieHostProviders map[string][]mt.MovieProvider } func New(db *gorm.DB, timeout time.Duration) *Engine { @@ -48,12 +48,12 @@ func Default() *Engine { // initActorProviders initializes actor providers. func (e *Engine) initActorProviders(timeout time.Duration) { { // init - e.actorProviders = make(map[string]javtube.ActorProvider) - e.actorHostProviders = make(map[string][]javtube.ActorProvider) + e.actorProviders = make(map[string]mt.ActorProvider) + e.actorHostProviders = make(map[string][]mt.ActorProvider) } - javtube.RangeActorFactory(func(name string, factory javtube.ActorFactory) { + mt.RangeActorFactory(func(name string, factory mt.ActorFactory) { provider := factory() - if s, ok := provider.(javtube.RequestTimeoutSetter); ok { + if s, ok := provider.(mt.RequestTimeoutSetter); ok { s.SetRequestTimeout(timeout) } // Add actor provider by name. @@ -67,12 +67,12 @@ func (e *Engine) initActorProviders(timeout time.Duration) { // initMovieProviders initializes movie providers. func (e *Engine) initMovieProviders(timeout time.Duration) { { // init - e.movieProviders = make(map[string]javtube.MovieProvider) - e.movieHostProviders = make(map[string][]javtube.MovieProvider) + e.movieProviders = make(map[string]mt.MovieProvider) + e.movieHostProviders = make(map[string][]mt.MovieProvider) } - javtube.RangeMovieFactory(func(name string, factory javtube.MovieFactory) { + mt.RangeMovieFactory(func(name string, factory mt.MovieFactory) { provider := factory() - if s, ok := provider.(javtube.RequestTimeoutSetter); ok { + if s, ok := provider.(mt.RequestTimeoutSetter); ok { s.SetRequestTimeout(timeout) } // Add movie provider by name. @@ -88,11 +88,11 @@ func (e *Engine) IsActorProvider(name string) (ok bool) { return } -func (e *Engine) GetActorProviders() map[string]javtube.ActorProvider { +func (e *Engine) GetActorProviders() map[string]mt.ActorProvider { return e.actorProviders } -func (e *Engine) GetActorProviderByURL(rawURL string) (javtube.ActorProvider, error) { +func (e *Engine) GetActorProviderByURL(rawURL string) (mt.ActorProvider, error) { u, err := url.Parse(rawURL) if err != nil { return nil, err @@ -102,18 +102,18 @@ func (e *Engine) GetActorProviderByURL(rawURL string) (javtube.ActorProvider, er return p, nil } } - return nil, javtube.ErrProviderNotFound + return nil, mt.ErrProviderNotFound } -func (e *Engine) GetActorProviderByName(name string) (javtube.ActorProvider, error) { +func (e *Engine) GetActorProviderByName(name string) (mt.ActorProvider, error) { provider, ok := e.actorProviders[strings.ToUpper(name)] if !ok { - return nil, javtube.ErrProviderNotFound + return nil, mt.ErrProviderNotFound } return provider, nil } -func (e *Engine) MustGetActorProviderByName(name string) javtube.ActorProvider { +func (e *Engine) MustGetActorProviderByName(name string) mt.ActorProvider { provider, err := e.GetActorProviderByName(name) if err != nil { panic(err) @@ -126,11 +126,11 @@ func (e *Engine) IsMovieProvider(name string) (ok bool) { return } -func (e *Engine) GetMovieProviders() map[string]javtube.MovieProvider { +func (e *Engine) GetMovieProviders() map[string]mt.MovieProvider { return e.movieProviders } -func (e *Engine) GetMovieProviderByURL(rawURL string) (javtube.MovieProvider, error) { +func (e *Engine) GetMovieProviderByURL(rawURL string) (mt.MovieProvider, error) { u, err := url.Parse(rawURL) if err != nil { return nil, err @@ -140,18 +140,18 @@ func (e *Engine) GetMovieProviderByURL(rawURL string) (javtube.MovieProvider, er return p, nil } } - return nil, javtube.ErrProviderNotFound + return nil, mt.ErrProviderNotFound } -func (e *Engine) GetMovieProviderByName(name string) (javtube.MovieProvider, error) { +func (e *Engine) GetMovieProviderByName(name string) (mt.MovieProvider, error) { provider, ok := e.movieProviders[strings.ToUpper(name)] if !ok { - return nil, javtube.ErrProviderNotFound + return nil, mt.ErrProviderNotFound } return provider, nil } -func (e *Engine) MustGetMovieProviderByName(name string) javtube.MovieProvider { +func (e *Engine) MustGetMovieProviderByName(name string) mt.MovieProvider { provider, err := e.GetMovieProviderByName(name) if err != nil { panic(err) @@ -177,10 +177,10 @@ func (e *Engine) AutoMigrate(v bool) error { // Fetch fetches content from url. If provider is nil, the // default fetcher will be used. -func (e *Engine) Fetch(url string, provider javtube.Provider) (*http.Response, error) { +func (e *Engine) Fetch(url string, provider mt.Provider) (*http.Response, error) { // Provider which implements Fetcher interface should be // used to fetch all its corresponding resources. - if fetcher, ok := provider.(javtube.Fetcher); ok { + if fetcher, ok := provider.(mt.Fetcher); ok { return fetcher.Fetch(url) } return e.fetcher.Fetch(url) diff --git a/engine/image.go b/engine/image.go index 424ebfb..a963c2e 100644 --- a/engine/image.go +++ b/engine/image.go @@ -3,12 +3,12 @@ package engine import ( "image" - "github.com/javtube/javtube-sdk-go/common/number" - R "github.com/javtube/javtube-sdk-go/constant" - "github.com/javtube/javtube-sdk-go/imageutil" - "github.com/javtube/javtube-sdk-go/imageutil/pigo" - "github.com/javtube/javtube-sdk-go/model" - javtube "github.com/javtube/javtube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/common/number" + R "github.com/javtube/metatube-sdk-go/constant" + "github.com/javtube/metatube-sdk-go/imageutil" + "github.com/javtube/metatube-sdk-go/imageutil/pigo" + "github.com/javtube/metatube-sdk-go/model" + mt "github.com/javtube/metatube-sdk-go/provider" ) // Default position constants for different kind of images. @@ -25,7 +25,7 @@ func (e *Engine) GetActorPrimaryImage(name, id string) (image.Image, error) { return nil, err } if len(info.Images) == 0 { - return nil, javtube.ErrImageNotFound + return nil, mt.ErrImageNotFound } return e.GetImageByURL(e.MustGetActorProviderByName(name), info.Images[0], R.PrimaryImageRatio, defaultActorPrimaryImagePosition, false) } @@ -62,7 +62,7 @@ func (e *Engine) GetMovieBackdropImage(name, id string) (image.Image, error) { return e.GetImageByURL(e.MustGetMovieProviderByName(name), url, R.BackdropImageRatio, defaultMovieBackdropImagePosition, false) } -func (e *Engine) GetImageByURL(provider javtube.Provider, url string, ratio, pos float64, auto bool) (img image.Image, err error) { +func (e *Engine) GetImageByURL(provider mt.Provider, url string, ratio, pos float64, auto bool) (img image.Image, err error) { if img, err = e.getImageByURL(provider, url); err != nil { return } @@ -72,7 +72,7 @@ func (e *Engine) GetImageByURL(provider javtube.Provider, url string, ratio, pos return imageutil.CropImagePosition(img, ratio, pos), nil } -func (e *Engine) getImageByURL(provider javtube.Provider, url string) (img image.Image, err error) { +func (e *Engine) getImageByURL(provider mt.Provider, url string) (img image.Image, err error) { resp, err := e.Fetch(url, provider) if err != nil { return diff --git a/engine/internal/utils/set.go b/engine/internal/utils/set.go index 6dfb2fc..1ff1a47 100644 --- a/engine/internal/utils/set.go +++ b/engine/internal/utils/set.go @@ -3,7 +3,7 @@ package utils import ( "github.com/iancoleman/orderedmap" - "github.com/javtube/javtube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/model" ) type ActorSearchResultSet struct { diff --git a/engine/movie.go b/engine/movie.go index d242356..f5fec2f 100644 --- a/engine/movie.go +++ b/engine/movie.go @@ -5,15 +5,15 @@ import ( "gorm.io/gorm/clause" - "github.com/javtube/javtube-sdk-go/common/comparer" - "github.com/javtube/javtube-sdk-go/common/number" - "github.com/javtube/javtube-sdk-go/common/priority" - "github.com/javtube/javtube-sdk-go/engine/internal/utils" - "github.com/javtube/javtube-sdk-go/model" - javtube "github.com/javtube/javtube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/common/comparer" + "github.com/javtube/metatube-sdk-go/common/number" + "github.com/javtube/metatube-sdk-go/common/priority" + "github.com/javtube/metatube-sdk-go/engine/internal/utils" + "github.com/javtube/metatube-sdk-go/model" + mt "github.com/javtube/metatube-sdk-go/provider" ) -func (e *Engine) searchMovieFromDB(keyword string, provider javtube.MovieProvider, all bool) (results []*model.MovieSearchResult, err error) { +func (e *Engine) searchMovieFromDB(keyword string, provider mt.MovieProvider, all bool) (results []*model.MovieSearchResult, err error) { var infos []*model.MovieInfo tx := e.db. // Note: keyword might be an ID or just a regular number, so we should @@ -40,11 +40,11 @@ func (e *Engine) searchMovieFromDB(keyword string, provider javtube.MovieProvide return } -func (e *Engine) searchMovie(keyword string, provider javtube.MovieProvider, fallback bool) (results []*model.MovieSearchResult, err error) { +func (e *Engine) searchMovie(keyword string, provider mt.MovieProvider, fallback bool) (results []*model.MovieSearchResult, err error) { // Regular keyword searching. - if searcher, ok := provider.(javtube.MovieSearcher); ok { + if searcher, ok := provider.(mt.MovieSearcher); ok { if keyword = searcher.NormalizeKeyword(keyword); keyword == "" { - return nil, javtube.ErrInvalidKeyword + return nil, mt.ErrInvalidKeyword } if fallback { defer func() { @@ -73,7 +73,7 @@ func (e *Engine) searchMovie(keyword string, provider javtube.MovieProvider, fal func (e *Engine) SearchMovie(keyword, name string, fallback bool) ([]*model.MovieSearchResult, error) { if keyword = number.Trim(keyword); keyword == "" { - return nil, javtube.ErrInvalidKeyword + return nil, mt.ErrInvalidKeyword } provider, err := e.GetMovieProviderByName(name) if err != nil { @@ -93,7 +93,7 @@ func (e *Engine) searchMovieAll(keyword string) (results []*model.MovieSearchRes for _, provider := range e.movieProviders { wg.Add(1) // Async searching. - go func(provider javtube.MovieProvider) { + go func(provider mt.MovieProvider) { defer wg.Done() innerResults, innerErr := e.searchMovie(keyword, provider, false) respCh <- response{ @@ -121,7 +121,7 @@ func (e *Engine) searchMovieAll(keyword string) (results []*model.MovieSearchRes // SearchMovieAll searches the keyword from all providers. func (e *Engine) SearchMovieAll(keyword string, fallback bool) (results []*model.MovieSearchResult, err error) { if keyword = number.Trim(keyword); keyword == "" { - return nil, javtube.ErrInvalidKeyword + return nil, mt.ErrInvalidKeyword } defer func() { @@ -129,7 +129,7 @@ func (e *Engine) SearchMovieAll(keyword string, fallback bool) (results []*model return } if len(results) == 0 { - err = javtube.ErrInfoNotFound + err = mt.ErrInfoNotFound return } // remove duplicate results, if any. @@ -165,7 +165,7 @@ func (e *Engine) SearchMovieAll(keyword string, fallback bool) (results []*model return } -func (e *Engine) getMovieInfoFromDB(provider javtube.MovieProvider, id string) (*model.MovieInfo, error) { +func (e *Engine) getMovieInfoFromDB(provider mt.MovieProvider, id string) (*model.MovieInfo, error) { info := &model.MovieInfo{} err := e.db. // Exact match here. Where("provider = ?", provider.Name()). @@ -174,11 +174,11 @@ func (e *Engine) getMovieInfoFromDB(provider javtube.MovieProvider, id string) ( return info, err } -func (e *Engine) getMovieInfoWithCallback(provider javtube.MovieProvider, id string, lazy bool, callback func() (*model.MovieInfo, error)) (info *model.MovieInfo, err error) { +func (e *Engine) getMovieInfoWithCallback(provider mt.MovieProvider, id string, lazy bool, callback func() (*model.MovieInfo, error)) (info *model.MovieInfo, err error) { defer func() { // metadata validation check. if err == nil && (info == nil || !info.Valid()) { - err = javtube.ErrIncompleteMetadata + err = mt.ErrIncompleteMetadata } }() // Query DB first (by id). @@ -198,9 +198,9 @@ func (e *Engine) getMovieInfoWithCallback(provider javtube.MovieProvider, id str return callback() } -func (e *Engine) getMovieInfoByProviderID(provider javtube.MovieProvider, id string, lazy bool) (*model.MovieInfo, error) { +func (e *Engine) getMovieInfoByProviderID(provider mt.MovieProvider, id string, lazy bool) (*model.MovieInfo, error) { if id = provider.NormalizeID(id); id == "" { - return nil, javtube.ErrInvalidID + return nil, mt.ErrInvalidID } return e.getMovieInfoWithCallback(provider, id, lazy, func() (*model.MovieInfo, error) { return provider.GetMovieInfoByID(id) @@ -215,13 +215,13 @@ func (e *Engine) GetMovieInfoByProviderID(name, id string, lazy bool) (*model.Mo return e.getMovieInfoByProviderID(provider, id, lazy) } -func (e *Engine) getMovieInfoByProviderURL(provider javtube.MovieProvider, rawURL string, lazy bool) (*model.MovieInfo, error) { +func (e *Engine) getMovieInfoByProviderURL(provider mt.MovieProvider, rawURL string, lazy bool) (*model.MovieInfo, error) { id, err := provider.ParseIDFromURL(rawURL) switch { case err != nil: return nil, err case id == "": - return nil, javtube.ErrInvalidURL + return nil, mt.ErrInvalidURL } return e.getMovieInfoWithCallback(provider, id, lazy, func() (*model.MovieInfo, error) { return provider.GetMovieInfoByURL(rawURL) diff --git a/engine/register.go b/engine/register.go index 7a11a91..dfdd7fc 100644 --- a/engine/register.go +++ b/engine/register.go @@ -2,37 +2,37 @@ package engine // Register Providers import ( - _ "github.com/javtube/javtube-sdk-go/provider/10musume" - _ "github.com/javtube/javtube-sdk-go/provider/1pondo" - _ "github.com/javtube/javtube-sdk-go/provider/airav" - _ "github.com/javtube/javtube-sdk-go/provider/arzon" - _ "github.com/javtube/javtube-sdk-go/provider/aventertainments" - _ "github.com/javtube/javtube-sdk-go/provider/avwiki" - _ "github.com/javtube/javtube-sdk-go/provider/c0930" - _ "github.com/javtube/javtube-sdk-go/provider/caribbeancom" - _ "github.com/javtube/javtube-sdk-go/provider/caribbeancompr" - _ "github.com/javtube/javtube-sdk-go/provider/duga" - _ "github.com/javtube/javtube-sdk-go/provider/fanza" - _ "github.com/javtube/javtube-sdk-go/provider/fc2" - _ "github.com/javtube/javtube-sdk-go/provider/fc2hub" - _ "github.com/javtube/javtube-sdk-go/provider/gcolle" - _ "github.com/javtube/javtube-sdk-go/provider/getchu" - _ "github.com/javtube/javtube-sdk-go/provider/gfriends" - _ "github.com/javtube/javtube-sdk-go/provider/h0930" - _ "github.com/javtube/javtube-sdk-go/provider/h4610" - _ "github.com/javtube/javtube-sdk-go/provider/heydouga" - _ "github.com/javtube/javtube-sdk-go/provider/heyzo" - _ "github.com/javtube/javtube-sdk-go/provider/jav321" - _ "github.com/javtube/javtube-sdk-go/provider/javbus" - _ "github.com/javtube/javtube-sdk-go/provider/kin8tengoku" - _ "github.com/javtube/javtube-sdk-go/provider/mgstage" - _ "github.com/javtube/javtube-sdk-go/provider/muramura" - _ "github.com/javtube/javtube-sdk-go/provider/mywife" - _ "github.com/javtube/javtube-sdk-go/provider/pacopacomama" - _ "github.com/javtube/javtube-sdk-go/provider/pcolle" - _ "github.com/javtube/javtube-sdk-go/provider/prestige" - _ "github.com/javtube/javtube-sdk-go/provider/sod" - _ "github.com/javtube/javtube-sdk-go/provider/tokyo-hot" - _ "github.com/javtube/javtube-sdk-go/provider/xslist" - _ "github.com/javtube/javtube-sdk-go/provider/xxx-av" + _ "github.com/javtube/metatube-sdk-go/provider/10musume" + _ "github.com/javtube/metatube-sdk-go/provider/1pondo" + _ "github.com/javtube/metatube-sdk-go/provider/airav" + _ "github.com/javtube/metatube-sdk-go/provider/arzon" + _ "github.com/javtube/metatube-sdk-go/provider/aventertainments" + _ "github.com/javtube/metatube-sdk-go/provider/avwiki" + _ "github.com/javtube/metatube-sdk-go/provider/c0930" + _ "github.com/javtube/metatube-sdk-go/provider/caribbeancom" + _ "github.com/javtube/metatube-sdk-go/provider/caribbeancompr" + _ "github.com/javtube/metatube-sdk-go/provider/duga" + _ "github.com/javtube/metatube-sdk-go/provider/fanza" + _ "github.com/javtube/metatube-sdk-go/provider/fc2" + _ "github.com/javtube/metatube-sdk-go/provider/fc2hub" + _ "github.com/javtube/metatube-sdk-go/provider/gcolle" + _ "github.com/javtube/metatube-sdk-go/provider/getchu" + _ "github.com/javtube/metatube-sdk-go/provider/gfriends" + _ "github.com/javtube/metatube-sdk-go/provider/h0930" + _ "github.com/javtube/metatube-sdk-go/provider/h4610" + _ "github.com/javtube/metatube-sdk-go/provider/heydouga" + _ "github.com/javtube/metatube-sdk-go/provider/heyzo" + _ "github.com/javtube/metatube-sdk-go/provider/jav321" + _ "github.com/javtube/metatube-sdk-go/provider/javbus" + _ "github.com/javtube/metatube-sdk-go/provider/kin8tengoku" + _ "github.com/javtube/metatube-sdk-go/provider/mgstage" + _ "github.com/javtube/metatube-sdk-go/provider/muramura" + _ "github.com/javtube/metatube-sdk-go/provider/mywife" + _ "github.com/javtube/metatube-sdk-go/provider/pacopacomama" + _ "github.com/javtube/metatube-sdk-go/provider/pcolle" + _ "github.com/javtube/metatube-sdk-go/provider/prestige" + _ "github.com/javtube/metatube-sdk-go/provider/sod" + _ "github.com/javtube/metatube-sdk-go/provider/tokyo-hot" + _ "github.com/javtube/metatube-sdk-go/provider/xslist" + _ "github.com/javtube/metatube-sdk-go/provider/xxx-av" ) diff --git a/go.mod b/go.mod index 06bdeec..4f3b5c0 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/javtube/javtube-sdk-go +module github.com/javtube/metatube-sdk-go go 1.19 diff --git a/imageutil/badge/badge.go b/imageutil/badge/badge.go index 662e484..334786f 100644 --- a/imageutil/badge/badge.go +++ b/imageutil/badge/badge.go @@ -7,8 +7,8 @@ import ( "github.com/jellydator/ttlcache/v3" - "github.com/javtube/javtube-sdk-go/common/fetch" - "github.com/javtube/javtube-sdk-go/imageutil" + "github.com/javtube/metatube-sdk-go/common/fetch" + "github.com/javtube/metatube-sdk-go/imageutil" ) var ( diff --git a/provider/10musume/10musume.go b/provider/10musume/10musume.go index 16633e4..ca8c72f 100644 --- a/provider/10musume/10musume.go +++ b/provider/10musume/10musume.go @@ -3,8 +3,8 @@ package tenmusume import ( "regexp" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/1pondo/core" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/1pondo/core" ) var _ provider.MovieProvider = (*TenMusume)(nil) diff --git a/provider/1pondo/1pondo.go b/provider/1pondo/1pondo.go index ff61e62..e319bf6 100644 --- a/provider/1pondo/1pondo.go +++ b/provider/1pondo/1pondo.go @@ -3,8 +3,8 @@ package onepondo import ( "regexp" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/1pondo/core" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/1pondo/core" ) var _ provider.MovieProvider = (*OnePondo)(nil) diff --git a/provider/1pondo/core/core.go b/provider/1pondo/core/core.go index 67e2254..9076920 100644 --- a/provider/1pondo/core/core.go +++ b/provider/1pondo/core/core.go @@ -13,9 +13,9 @@ import ( "github.com/gocolly/colly/v2" "github.com/nlnwa/whatwg-url/url" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) // API Paths diff --git a/provider/airav/airav.go b/provider/airav/airav.go index 429273d..cf85db0 100644 --- a/provider/airav/airav.go +++ b/provider/airav/airav.go @@ -9,10 +9,10 @@ import ( "github.com/gocolly/colly/v2" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var ( diff --git a/provider/arzon/arzon.go b/provider/arzon/arzon.go index 3880a84..e1dbfc4 100644 --- a/provider/arzon/arzon.go +++ b/provider/arzon/arzon.go @@ -10,12 +10,12 @@ import ( "github.com/gocolly/colly/v2" "golang.org/x/net/html" - "github.com/javtube/javtube-sdk-go/common/fetch" - "github.com/javtube/javtube-sdk-go/common/number" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/fetch" + "github.com/javtube/metatube-sdk-go/common/number" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var ( diff --git a/provider/aventertainments/aventertainments.go b/provider/aventertainments/aventertainments.go index da60827..20a8836 100644 --- a/provider/aventertainments/aventertainments.go +++ b/provider/aventertainments/aventertainments.go @@ -10,11 +10,11 @@ import ( "github.com/gocolly/colly/v2" "golang.org/x/net/html" - "github.com/javtube/javtube-sdk-go/common/number" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/number" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var ( diff --git a/provider/avwiki/avwiki.go b/provider/avwiki/avwiki.go index 6ddf87c..58549df 100644 --- a/provider/avwiki/avwiki.go +++ b/provider/avwiki/avwiki.go @@ -12,17 +12,17 @@ import ( "github.com/gocolly/colly/v2" - "github.com/javtube/javtube-sdk-go/common/number" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/common/singledo" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/duga" - "github.com/javtube/javtube-sdk-go/provider/fanza" - "github.com/javtube/javtube-sdk-go/provider/getchu" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" - "github.com/javtube/javtube-sdk-go/provider/mgstage" - "github.com/javtube/javtube-sdk-go/provider/pcolle" + "github.com/javtube/metatube-sdk-go/common/number" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/common/singledo" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/duga" + "github.com/javtube/metatube-sdk-go/provider/fanza" + "github.com/javtube/metatube-sdk-go/provider/getchu" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/provider/mgstage" + "github.com/javtube/metatube-sdk-go/provider/pcolle" ) var ( diff --git a/provider/c0930/c0930.go b/provider/c0930/c0930.go index 2a3efb8..4e1bcd7 100644 --- a/provider/c0930/c0930.go +++ b/provider/c0930/c0930.go @@ -4,8 +4,8 @@ import ( "regexp" "strings" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/h0930/core" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/h0930/core" ) var _ provider.MovieProvider = (*C0930)(nil) diff --git a/provider/caribbeancom/caribbeancom.go b/provider/caribbeancom/caribbeancom.go index 3f7ca6e..9e3bb10 100644 --- a/provider/caribbeancom/caribbeancom.go +++ b/provider/caribbeancom/caribbeancom.go @@ -3,8 +3,8 @@ package caribbeancom import ( "regexp" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/caribbeancom/core" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/caribbeancom/core" ) var _ provider.MovieProvider = (*Caribbeancom)(nil) diff --git a/provider/caribbeancom/core/core.go b/provider/caribbeancom/core/core.go index dedbdd9..86ab53a 100644 --- a/provider/caribbeancom/core/core.go +++ b/provider/caribbeancom/core/core.go @@ -13,9 +13,9 @@ import ( "github.com/gocolly/colly/v2" "golang.org/x/net/html" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) type Core struct { diff --git a/provider/caribbeancompr/caribbeancompr.go b/provider/caribbeancompr/caribbeancompr.go index caffea2..8bc1d30 100644 --- a/provider/caribbeancompr/caribbeancompr.go +++ b/provider/caribbeancompr/caribbeancompr.go @@ -3,8 +3,8 @@ package caribbeancompr import ( "regexp" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/caribbeancom/core" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/caribbeancom/core" ) var _ provider.MovieProvider = (*CaribbeancomPremium)(nil) diff --git a/provider/duga/duga.go b/provider/duga/duga.go index 1ab9402..9e95c8b 100644 --- a/provider/duga/duga.go +++ b/provider/duga/duga.go @@ -11,11 +11,11 @@ import ( "github.com/gocolly/colly/v2" - "github.com/javtube/javtube-sdk-go/common/number" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/number" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var ( diff --git a/provider/errors.go b/provider/errors.go index 4b947f8..c94c426 100644 --- a/provider/errors.go +++ b/provider/errors.go @@ -3,7 +3,7 @@ package provider import ( "net/http" - "github.com/javtube/javtube-sdk-go/errors" + "github.com/javtube/metatube-sdk-go/errors" ) var ( diff --git a/provider/fanza/fanza.go b/provider/fanza/fanza.go index d8c2344..ca4ec8f 100644 --- a/provider/fanza/fanza.go +++ b/provider/fanza/fanza.go @@ -17,13 +17,13 @@ import ( "github.com/gocolly/colly/v2" "golang.org/x/net/html" - "github.com/javtube/javtube-sdk-go/common/comparer" - "github.com/javtube/javtube-sdk-go/common/number" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/imhelper" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/comparer" + "github.com/javtube/metatube-sdk-go/common/number" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/imhelper" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var ( diff --git a/provider/fc2/fc2.go b/provider/fc2/fc2.go index 4894886..278a161 100644 --- a/provider/fc2/fc2.go +++ b/provider/fc2/fc2.go @@ -9,10 +9,10 @@ import ( "github.com/gocolly/colly/v2" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var _ provider.MovieProvider = (*FC2)(nil) diff --git a/provider/fc2hub/fc2hub.go b/provider/fc2hub/fc2hub.go index 311f9a0..d5628ea 100644 --- a/provider/fc2hub/fc2hub.go +++ b/provider/fc2hub/fc2hub.go @@ -11,11 +11,11 @@ import ( "github.com/gocolly/colly/v2" "golang.org/x/net/html" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/fc2" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/fc2" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var ( diff --git a/provider/gcolle/gcolle.go b/provider/gcolle/gcolle.go index d99015d..d532593 100644 --- a/provider/gcolle/gcolle.go +++ b/provider/gcolle/gcolle.go @@ -10,10 +10,10 @@ import ( "github.com/gocolly/colly/v2" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var _ provider.MovieProvider = (*Gcolle)(nil) diff --git a/provider/getchu/getchu.go b/provider/getchu/getchu.go index 55e89fa..c15e1c4 100644 --- a/provider/getchu/getchu.go +++ b/provider/getchu/getchu.go @@ -11,10 +11,10 @@ import ( "github.com/gocolly/colly/v2" "golang.org/x/net/html" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var _ provider.MovieProvider = (*Getchu)(nil) diff --git a/provider/gfriends/gfriends.go b/provider/gfriends/gfriends.go index 32a9a6d..c40d523 100644 --- a/provider/gfriends/gfriends.go +++ b/provider/gfriends/gfriends.go @@ -9,11 +9,11 @@ import ( "github.com/iancoleman/orderedmap" - "github.com/javtube/javtube-sdk-go/common/fetch" - "github.com/javtube/javtube-sdk-go/common/reverse" - "github.com/javtube/javtube-sdk-go/common/singledo" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/common/fetch" + "github.com/javtube/metatube-sdk-go/common/reverse" + "github.com/javtube/metatube-sdk-go/common/singledo" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" ) var ( diff --git a/provider/h0930/core/core.go b/provider/h0930/core/core.go index 71ce9f1..71e2ac3 100644 --- a/provider/h0930/core/core.go +++ b/provider/h0930/core/core.go @@ -11,9 +11,9 @@ import ( "github.com/gocolly/colly/v2" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) type Core struct { diff --git a/provider/h0930/h0930.go b/provider/h0930/h0930.go index d2881fc..1b4ed76 100644 --- a/provider/h0930/h0930.go +++ b/provider/h0930/h0930.go @@ -4,8 +4,8 @@ import ( "regexp" "strings" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/h0930/core" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/h0930/core" ) var _ provider.MovieProvider = (*H0930)(nil) diff --git a/provider/h4610/h4610.go b/provider/h4610/h4610.go index 4489cd3..6652e63 100644 --- a/provider/h4610/h4610.go +++ b/provider/h4610/h4610.go @@ -4,8 +4,8 @@ import ( "regexp" "strings" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/h0930/core" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/h0930/core" ) var _ provider.MovieProvider = (*H4610)(nil) diff --git a/provider/heydouga/heydouga.go b/provider/heydouga/heydouga.go index 83827aa..79c005a 100644 --- a/provider/heydouga/heydouga.go +++ b/provider/heydouga/heydouga.go @@ -11,10 +11,10 @@ import ( "github.com/gocolly/colly/v2" "golang.org/x/net/html" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var _ provider.MovieProvider = (*HeyDouga)(nil) diff --git a/provider/heyzo/heyzo.go b/provider/heyzo/heyzo.go index 83b2747..3f866ae 100644 --- a/provider/heyzo/heyzo.go +++ b/provider/heyzo/heyzo.go @@ -11,11 +11,11 @@ import ( "github.com/gocolly/colly/v2" - "github.com/javtube/javtube-sdk-go/common/m3u8" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/m3u8" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var _ provider.MovieProvider = (*Heyzo)(nil) diff --git a/provider/internal/imhelper/image.go b/provider/internal/imhelper/image.go index 76fe1b4..7411cdb 100644 --- a/provider/internal/imhelper/image.go +++ b/provider/internal/imhelper/image.go @@ -5,9 +5,9 @@ import ( "math" "sync" - "github.com/javtube/javtube-sdk-go/common/fetch" - "github.com/javtube/javtube-sdk-go/imageutil" - "github.com/javtube/javtube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/common/fetch" + "github.com/javtube/metatube-sdk-go/imageutil" + "github.com/javtube/metatube-sdk-go/provider" ) var imageFetcher = fetch.Default(nil) diff --git a/provider/internal/scraper/option.go b/provider/internal/scraper/option.go index bb0fdab..e1a2ebf 100644 --- a/provider/internal/scraper/option.go +++ b/provider/internal/scraper/option.go @@ -7,7 +7,7 @@ import ( "github.com/gocolly/colly/v2" "github.com/gocolly/colly/v2/debug" - "github.com/javtube/javtube-sdk-go/common/random" + "github.com/javtube/metatube-sdk-go/common/random" ) type Option func(*Scraper) error diff --git a/provider/internal/scraper/scraper.go b/provider/internal/scraper/scraper.go index ee93fd6..9f444e2 100644 --- a/provider/internal/scraper/scraper.go +++ b/provider/internal/scraper/scraper.go @@ -6,7 +6,7 @@ import ( "github.com/gocolly/colly/v2" - "github.com/javtube/javtube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider" ) var _ provider.Provider = (*Scraper)(nil) diff --git a/provider/jav321/jav321.go b/provider/jav321/jav321.go index f1a350b..72a78ce 100644 --- a/provider/jav321/jav321.go +++ b/provider/jav321/jav321.go @@ -11,11 +11,11 @@ import ( "github.com/gocolly/colly/v2" "golang.org/x/net/html" - "github.com/javtube/javtube-sdk-go/common/number" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/number" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var ( diff --git a/provider/javbus/javbus.go b/provider/javbus/javbus.go index d5ac916..87882ac 100644 --- a/provider/javbus/javbus.go +++ b/provider/javbus/javbus.go @@ -11,11 +11,11 @@ import ( "github.com/gocolly/colly/v2" - "github.com/javtube/javtube-sdk-go/common/number" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/number" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var ( diff --git a/provider/kin8tengoku/kin8tengoku.go b/provider/kin8tengoku/kin8tengoku.go index 7fc9369..b99b5c9 100644 --- a/provider/kin8tengoku/kin8tengoku.go +++ b/provider/kin8tengoku/kin8tengoku.go @@ -14,10 +14,10 @@ import ( "github.com/gocolly/colly/v2" "golang.org/x/net/html" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var _ provider.MovieProvider = (*KIN8)(nil) diff --git a/provider/mgstage/mgstage.go b/provider/mgstage/mgstage.go index 9091a43..37c7e50 100644 --- a/provider/mgstage/mgstage.go +++ b/provider/mgstage/mgstage.go @@ -14,11 +14,11 @@ import ( "github.com/gocolly/colly/v2" "golang.org/x/net/html" - "github.com/javtube/javtube-sdk-go/common/number" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/number" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var ( diff --git a/provider/muramura/muramura.go b/provider/muramura/muramura.go index 97241a0..9b3a9af 100644 --- a/provider/muramura/muramura.go +++ b/provider/muramura/muramura.go @@ -3,8 +3,8 @@ package muramura import ( "regexp" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/1pondo/core" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/1pondo/core" ) var _ provider.MovieProvider = (*MuraMura)(nil) diff --git a/provider/mywife/mywife.go b/provider/mywife/mywife.go index 74de10e..9537e5a 100644 --- a/provider/mywife/mywife.go +++ b/provider/mywife/mywife.go @@ -9,9 +9,9 @@ import ( "github.com/gocolly/colly/v2" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var _ provider.MovieProvider = (*MyWife)(nil) diff --git a/provider/pacopacomama/pacopacomama.go b/provider/pacopacomama/pacopacomama.go index 50fd716..0d79d1a 100644 --- a/provider/pacopacomama/pacopacomama.go +++ b/provider/pacopacomama/pacopacomama.go @@ -3,8 +3,8 @@ package pacopacomama import ( "regexp" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/1pondo/core" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/1pondo/core" ) var _ provider.MovieProvider = (*Pacopacomama)(nil) diff --git a/provider/pcolle/pcolle.go b/provider/pcolle/pcolle.go index 5b611cd..7e28276 100644 --- a/provider/pcolle/pcolle.go +++ b/provider/pcolle/pcolle.go @@ -11,10 +11,10 @@ import ( "github.com/gocolly/colly/v2" "golang.org/x/net/html" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var _ provider.MovieProvider = (*Pcolle)(nil) diff --git a/provider/prestige/prestige.go b/provider/prestige/prestige.go index 7e1f267..c0c0fe1 100644 --- a/provider/prestige/prestige.go +++ b/provider/prestige/prestige.go @@ -12,11 +12,11 @@ import ( "github.com/gocolly/colly/v2" "golang.org/x/net/html" - "github.com/javtube/javtube-sdk-go/common/number" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/number" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var ( diff --git a/provider/provider.go b/provider/provider.go index 631bf4c..ebdc2fa 100644 --- a/provider/provider.go +++ b/provider/provider.go @@ -5,7 +5,7 @@ import ( "net/url" "time" - "github.com/javtube/javtube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/model" ) type Provider interface { diff --git a/provider/sod/sod.go b/provider/sod/sod.go index 5bc961c..4509b19 100644 --- a/provider/sod/sod.go +++ b/provider/sod/sod.go @@ -9,12 +9,12 @@ import ( "github.com/gocolly/colly/v2" "golang.org/x/net/html" - "github.com/javtube/javtube-sdk-go/common/fetch" - "github.com/javtube/javtube-sdk-go/common/number" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/fetch" + "github.com/javtube/metatube-sdk-go/common/number" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var ( diff --git a/provider/tokyo-hot/tokyo-hot.go b/provider/tokyo-hot/tokyo-hot.go index ec97ad0..17f0fe0 100644 --- a/provider/tokyo-hot/tokyo-hot.go +++ b/provider/tokyo-hot/tokyo-hot.go @@ -13,10 +13,10 @@ import ( "github.com/gocolly/colly/v2" "golang.org/x/net/html" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var ( diff --git a/provider/xslist/xslist.go b/provider/xslist/xslist.go index 16a7c47..8e4f8ee 100644 --- a/provider/xslist/xslist.go +++ b/provider/xslist/xslist.go @@ -12,10 +12,10 @@ import ( "golang.org/x/net/html" dt "gorm.io/datatypes" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var ( diff --git a/provider/xxx-av/xxx-av.go b/provider/xxx-av/xxx-av.go index 70660ff..544d930 100644 --- a/provider/xxx-av/xxx-av.go +++ b/provider/xxx-av/xxx-av.go @@ -12,10 +12,10 @@ import ( "github.com/gocolly/colly/v2" "golang.org/x/net/html" - "github.com/javtube/javtube-sdk-go/common/parser" - "github.com/javtube/javtube-sdk-go/model" - "github.com/javtube/javtube-sdk-go/provider" - "github.com/javtube/javtube-sdk-go/provider/internal/scraper" + "github.com/javtube/metatube-sdk-go/common/parser" + "github.com/javtube/metatube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/provider/internal/scraper" ) var _ provider.MovieProvider = (*TripleX)(nil) diff --git a/route/auth.go b/route/auth.go index e52fff3..eb44603 100644 --- a/route/auth.go +++ b/route/auth.go @@ -6,8 +6,8 @@ import ( "github.com/gin-gonic/gin" - "github.com/javtube/javtube-sdk-go/errors" - "github.com/javtube/javtube-sdk-go/route/auth" + "github.com/javtube/metatube-sdk-go/errors" + "github.com/javtube/metatube-sdk-go/route/auth" ) func authentication(v auth.Validator) gin.HandlerFunc { diff --git a/route/image.go b/route/image.go index 23aa712..e5a56a5 100644 --- a/route/image.go +++ b/route/image.go @@ -10,10 +10,10 @@ import ( "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/render" - R "github.com/javtube/javtube-sdk-go/constant" - "github.com/javtube/javtube-sdk-go/engine" - "github.com/javtube/javtube-sdk-go/imageutil/badge" - javtube "github.com/javtube/javtube-sdk-go/provider" + R "github.com/javtube/metatube-sdk-go/constant" + "github.com/javtube/metatube-sdk-go/engine" + "github.com/javtube/metatube-sdk-go/imageutil/badge" + mt "github.com/javtube/metatube-sdk-go/provider" ) type imageType uint8 @@ -73,7 +73,7 @@ func getImage(app *engine.Engine, typ imageType) gin.HandlerFunc { case app.IsMovieProvider(uri.Provider): isActorProvider = false default: - abortWithError(c, javtube.ErrProviderNotFound) + abortWithError(c, mt.ErrProviderNotFound) return } @@ -82,7 +82,7 @@ func getImage(app *engine.Engine, typ imageType) gin.HandlerFunc { err error ) if query.URL != "" /* specified URL */ { - var provider javtube.Provider + var provider mt.Provider if isActorProvider { provider = app.MustGetActorProviderByName(uri.Provider) } else { @@ -123,8 +123,8 @@ func getImage(app *engine.Engine, typ imageType) gin.HandlerFunc { } } - c.Header("X-JavTube-Image-Width", strconv.Itoa(img.Bounds().Dx())) - c.Header("X-JavTube-Image-Height", strconv.Itoa(img.Bounds().Dy())) + c.Header("X-MetaTube-Image-Width", strconv.Itoa(img.Bounds().Dx())) + c.Header("X-MetaTube-Image-Height", strconv.Itoa(img.Bounds().Dy())) buf := &bytes.Buffer{} if err = jpeg.Encode(buf, img, &jpeg.Options{Quality: query.Quality}); err != nil { diff --git a/route/info.go b/route/info.go index a7e7b72..538a092 100644 --- a/route/info.go +++ b/route/info.go @@ -5,7 +5,7 @@ import ( "github.com/gin-gonic/gin" - "github.com/javtube/javtube-sdk-go/engine" + "github.com/javtube/metatube-sdk-go/engine" ) type infoType uint8 diff --git a/route/redirect.go b/route/redirect.go index 71b8f20..2da69c7 100644 --- a/route/redirect.go +++ b/route/redirect.go @@ -6,9 +6,9 @@ import ( "github.com/gin-gonic/gin" - "github.com/javtube/javtube-sdk-go/engine" - "github.com/javtube/javtube-sdk-go/model" - javtube "github.com/javtube/javtube-sdk-go/provider" + "github.com/javtube/metatube-sdk-go/engine" + "github.com/javtube/metatube-sdk-go/model" + mt "github.com/javtube/metatube-sdk-go/provider" ) func redirect(app *engine.Engine) gin.HandlerFunc { @@ -36,7 +36,7 @@ func redirect(app *engine.Engine) gin.HandlerFunc { case app.IsMovieProvider(provider): info, err = app.GetMovieInfoByProviderID(provider, id, true) default: - abortWithError(c, javtube.ErrProviderNotFound) + abortWithError(c, mt.ErrProviderNotFound) return } if err != nil { diff --git a/route/route.go b/route/route.go index fca83d6..fe6677f 100644 --- a/route/route.go +++ b/route/route.go @@ -6,10 +6,10 @@ import ( "github.com/gin-gonic/gin" - "github.com/javtube/javtube-sdk-go/engine" - "github.com/javtube/javtube-sdk-go/errors" - V "github.com/javtube/javtube-sdk-go/internal/version" - "github.com/javtube/javtube-sdk-go/route/auth" + "github.com/javtube/metatube-sdk-go/engine" + "github.com/javtube/metatube-sdk-go/errors" + V "github.com/javtube/metatube-sdk-go/internal/version" + "github.com/javtube/metatube-sdk-go/route/auth" ) func New(app *engine.Engine, v auth.Validator) *gin.Engine { @@ -88,7 +88,7 @@ func getIndex() gin.HandlerFunc { return func(c *gin.Context) { c.JSON(http.StatusOK, &responseMessage{ Data: gin.H{ - "app": "javtube", + "app": "metatube", "commit": V.GitCommit, "version": V.Version, }, diff --git a/route/search.go b/route/search.go index 4b2d242..8e6b1db 100644 --- a/route/search.go +++ b/route/search.go @@ -6,9 +6,9 @@ import ( "github.com/gin-gonic/gin" - "github.com/javtube/javtube-sdk-go/engine" - "github.com/javtube/javtube-sdk-go/errors" - "github.com/javtube/javtube-sdk-go/model" + "github.com/javtube/metatube-sdk-go/engine" + "github.com/javtube/metatube-sdk-go/errors" + "github.com/javtube/metatube-sdk-go/model" ) type searchType uint8 diff --git a/route/translate.go b/route/translate.go index 9b19ea1..c1576f4 100644 --- a/route/translate.go +++ b/route/translate.go @@ -6,7 +6,7 @@ import ( "github.com/gin-gonic/gin" - "github.com/javtube/javtube-sdk-go/translate" + "github.com/javtube/metatube-sdk-go/translate" ) const ( diff --git a/translate/baidu.go b/translate/baidu.go index 31d2123..1d0bbae 100644 --- a/translate/baidu.go +++ b/translate/baidu.go @@ -11,7 +11,7 @@ import ( "strings" "time" - "github.com/javtube/javtube-sdk-go/common/fetch" + "github.com/javtube/metatube-sdk-go/common/fetch" ) const baiduTranslateAPI = "https://api.fanyi.baidu.com/api/trans/vip/translate" diff --git a/translate/deepl.go b/translate/deepl.go index 5cca511..925cbec 100644 --- a/translate/deepl.go +++ b/translate/deepl.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "github.com/javtube/javtube-sdk-go/common/fetch" + "github.com/javtube/metatube-sdk-go/common/fetch" ) const deeplTranslateAPI = "https://api-free.deepl.com/v2/translate" diff --git a/translate/google.go b/translate/google.go index c43c50e..c36f96e 100644 --- a/translate/google.go +++ b/translate/google.go @@ -7,8 +7,8 @@ import ( "golang.org/x/text/language" - "github.com/javtube/javtube-sdk-go/common/fetch" - "github.com/javtube/javtube-sdk-go/errors" + "github.com/javtube/metatube-sdk-go/common/fetch" + "github.com/javtube/metatube-sdk-go/errors" ) const googleTranslateAPI = "https://translation.googleapis.com/language/translate/v2"