mirror of https://github.com/pikami/tiktok-dl.git
Use go modules
This commit is contained in:
parent
0a08f62dfe
commit
70c3faf17e
|
@ -10,9 +10,9 @@ import (
|
|||
|
||||
"github.com/chromedp/chromedp"
|
||||
|
||||
config "../models/config"
|
||||
utils "../utils"
|
||||
log "../utils/log"
|
||||
config "github.com/pikami/tiktok-dl/models/config"
|
||||
utils "github.com/pikami/tiktok-dl/utils"
|
||||
log "github.com/pikami/tiktok-dl/utils/log"
|
||||
)
|
||||
|
||||
// GetMusicUploads - Get all uploads by given music
|
||||
|
|
|
@ -3,8 +3,8 @@ package client
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
models "../models"
|
||||
config "../models/config"
|
||||
models "github.com/pikami/tiktok-dl/models"
|
||||
config "github.com/pikami/tiktok-dl/models/config"
|
||||
)
|
||||
|
||||
// GetHashtagUploads - Get all uploads marked with given hashtag
|
||||
|
|
|
@ -3,8 +3,8 @@ package client
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
models "../models"
|
||||
config "../models/config"
|
||||
models "github.com/pikami/tiktok-dl/models"
|
||||
config "github.com/pikami/tiktok-dl/models/config"
|
||||
)
|
||||
|
||||
// GetMusicUploads - Get all uploads by given music
|
||||
|
|
|
@ -8,8 +8,8 @@ import (
|
|||
|
||||
"github.com/chromedp/chromedp"
|
||||
|
||||
config "../models/config"
|
||||
log "../utils/log"
|
||||
config "github.com/pikami/tiktok-dl/models/config"
|
||||
log "github.com/pikami/tiktok-dl/utils/log"
|
||||
)
|
||||
|
||||
// GetRedirectURL - Returns URL that the given URL redirects to
|
||||
|
|
|
@ -3,8 +3,8 @@ package client
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
models "../models"
|
||||
config "../models/config"
|
||||
models "github.com/pikami/tiktok-dl/models"
|
||||
config "github.com/pikami/tiktok-dl/models/config"
|
||||
)
|
||||
|
||||
// GetUserUploads - Get all uploads by user
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package client
|
||||
|
||||
import (
|
||||
models "../models"
|
||||
models "github.com/pikami/tiktok-dl/models"
|
||||
)
|
||||
|
||||
// GetVideoDetails - returns details of video
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
module github.com/pikami/tiktok-dl
|
||||
|
||||
go 1.14
|
||||
|
||||
require github.com/chromedp/chromedp v0.5.3
|
|
@ -0,0 +1,16 @@
|
|||
github.com/chromedp/cdproto v0.0.0-20200116234248-4da64dd111ac h1:T7V5BXqnYd55Hj/g5uhDYumg9Fp3rMTS6bykYtTIFX4=
|
||||
github.com/chromedp/cdproto v0.0.0-20200116234248-4da64dd111ac/go.mod h1:PfAWWKJqjlGFYJEidUM6aVIWPr0EpobeyVWEEmplX7g=
|
||||
github.com/chromedp/chromedp v0.5.3 h1:F9LafxmYpsQhWQBdCs+6Sret1zzeeFyHS5LkRF//Ffg=
|
||||
github.com/chromedp/chromedp v0.5.3/go.mod h1:YLdPtndaHQ4rCpSpBG+IPpy9JvX0VD+7aaLxYgYj28w=
|
||||
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0=
|
||||
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
|
||||
github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8=
|
||||
github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
|
||||
github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo=
|
||||
github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
|
||||
github.com/knq/sysutil v0.0.0-20191005231841-15668db23d08 h1:V0an7KRw92wmJysvFvtqtKMAPmvS5O0jtB0nYo6t+gs=
|
||||
github.com/knq/sysutil v0.0.0-20191005231841-15668db23d08/go.mod h1:dFWs1zEqDjFtnBXsd1vPOZaLsESovai349994nHx3e0=
|
||||
github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM=
|
||||
github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
4
main.go
4
main.go
|
@ -1,8 +1,8 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
config "./models/config"
|
||||
workflows "./workflows"
|
||||
config "github.com/pikami/tiktok-dl/models/config"
|
||||
workflows "github.com/pikami/tiktok-dl/workflows"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -5,9 +5,9 @@ import (
|
|||
"os"
|
||||
"strings"
|
||||
|
||||
res "../resources"
|
||||
checkErr "../utils/checkErr"
|
||||
log "../utils/log"
|
||||
res "github.com/pikami/tiktok-dl/resources"
|
||||
checkErr "github.com/pikami/tiktok-dl/utils/checkErr"
|
||||
log "github.com/pikami/tiktok-dl/utils/log"
|
||||
)
|
||||
|
||||
// Upload - Upload object
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"os"
|
||||
"testing"
|
||||
|
||||
testUtil "../unitTestUtil"
|
||||
fileio "../utils/fileio"
|
||||
testUtil "github.com/pikami/tiktok-dl/unitTestUtil"
|
||||
fileio "github.com/pikami/tiktok-dl/utils/fileio"
|
||||
)
|
||||
|
||||
func TestParseUploads(t *testing.T) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"test": "go test -v ./models && go test -v ./utils",
|
||||
"clean": "rm -rf out",
|
||||
"build:scraper": "node node_modules/terser/bin/terser -c -m -- scraper.js > out/scraper.js",
|
||||
"build:app": "go build -o out/ -v .",
|
||||
"build:app": "go build -o out/tiktok-dl -v .",
|
||||
"build:dist": "mkdir out && npm run build:app && npm run build:scraper",
|
||||
"build": "go build -v .",
|
||||
"sonar": "sonar-scanner -Dsonar.login=${SONAR_LOGIN} -Dproject.settings=.sonar/sonar-project.properties"
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package utils
|
||||
|
||||
import (
|
||||
models "../models"
|
||||
config "../models/config"
|
||||
fileio "./fileio"
|
||||
log "./log"
|
||||
models "github.com/pikami/tiktok-dl/models"
|
||||
config "github.com/pikami/tiktok-dl/models/config"
|
||||
fileio "github.com/pikami/tiktok-dl/utils/fileio"
|
||||
log "github.com/pikami/tiktok-dl/utils/log"
|
||||
)
|
||||
|
||||
// IsItemInArchive - Checks if the item is already archived
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"net/http"
|
||||
"os"
|
||||
|
||||
checkErr "./checkErr"
|
||||
checkErr "github.com/pikami/tiktok-dl/utils/checkErr"
|
||||
)
|
||||
|
||||
// DownloadFile - Downloads content from `url` and stores it in `outputPath`
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
checkErr "../checkErr"
|
||||
checkErr "github.com/pikami/tiktok-dl/utils/checkErr"
|
||||
)
|
||||
|
||||
type delegateString func(string)
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package utils
|
||||
|
||||
import (
|
||||
res "../resources"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
res "github.com/pikami/tiktok-dl/resources"
|
||||
)
|
||||
|
||||
// GetHashtagFromURL - Get's tag name from passed url
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
package utils
|
||||
|
||||
import (
|
||||
config "../models/config"
|
||||
res "../resources"
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
config "github.com/pikami/tiktok-dl/models/config"
|
||||
res "github.com/pikami/tiktok-dl/resources"
|
||||
)
|
||||
|
||||
// GetUsername - Get's username from passed URL param
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package utils
|
||||
|
||||
import (
|
||||
config "../models/config"
|
||||
testUtil "../unitTestUtil"
|
||||
"testing"
|
||||
|
||||
config "github.com/pikami/tiktok-dl/models/config"
|
||||
testUtil "github.com/pikami/tiktok-dl/unitTestUtil"
|
||||
)
|
||||
|
||||
func TestGetUsername(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
|
||||
config "../../models/config"
|
||||
config "github.com/pikami/tiktok-dl/models/config"
|
||||
)
|
||||
|
||||
// Log - Write to std out
|
||||
|
|
|
@ -3,7 +3,7 @@ package utils
|
|||
import (
|
||||
"io/ioutil"
|
||||
|
||||
checkErr "./checkErr"
|
||||
checkErr "github.com/pikami/tiktok-dl/utils/checkErr"
|
||||
)
|
||||
|
||||
// ReadFileAsString - Returns contents of given file
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package workflows
|
||||
|
||||
import (
|
||||
config "../models/config"
|
||||
res "../resources"
|
||||
fileio "../utils/fileio"
|
||||
log "../utils/log"
|
||||
config "github.com/pikami/tiktok-dl/models/config"
|
||||
res "github.com/pikami/tiktok-dl/resources"
|
||||
fileio "github.com/pikami/tiktok-dl/utils/fileio"
|
||||
log "github.com/pikami/tiktok-dl/utils/log"
|
||||
)
|
||||
|
||||
// OnWorkflowFail - Funtion called when workflow fails
|
||||
// OnWorkflowFail - Function called when workflow fails
|
||||
func OnWorkflowFail(err error, workItem string) {
|
||||
failLogFilePath := config.Config.FailLogFilePath
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package workflows
|
||||
|
||||
import (
|
||||
res "../resources"
|
||||
fileio "../utils/fileio"
|
||||
log "../utils/log"
|
||||
res "github.com/pikami/tiktok-dl/resources"
|
||||
fileio "github.com/pikami/tiktok-dl/utils/fileio"
|
||||
log "github.com/pikami/tiktok-dl/utils/log"
|
||||
)
|
||||
|
||||
// CanUseDownloadBatchFile - Check's if DownloadBatchFile can be used
|
||||
|
|
|
@ -4,11 +4,11 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
client "../client"
|
||||
config "../models/config"
|
||||
utils "../utils"
|
||||
fileio "../utils/fileio"
|
||||
log "../utils/log"
|
||||
client "github.com/pikami/tiktok-dl/client"
|
||||
config "github.com/pikami/tiktok-dl/models/config"
|
||||
utils "github.com/pikami/tiktok-dl/utils"
|
||||
fileio "github.com/pikami/tiktok-dl/utils/fileio"
|
||||
log "github.com/pikami/tiktok-dl/utils/log"
|
||||
)
|
||||
|
||||
// CanUseDownloadHashtag - Test's if this workflow can be used for parameter
|
||||
|
|
|
@ -4,11 +4,11 @@ import (
|
|||
"fmt"
|
||||
"regexp"
|
||||
|
||||
client "../client"
|
||||
config "../models/config"
|
||||
utils "../utils"
|
||||
fileio "../utils/fileio"
|
||||
log "../utils/log"
|
||||
client "github.com/pikami/tiktok-dl/client"
|
||||
config "github.com/pikami/tiktok-dl/models/config"
|
||||
utils "github.com/pikami/tiktok-dl/utils"
|
||||
fileio "github.com/pikami/tiktok-dl/utils/fileio"
|
||||
log "github.com/pikami/tiktok-dl/utils/log"
|
||||
)
|
||||
|
||||
// CanUseDownloadMusic - Check's if DownloadMusic can be used for parameter
|
||||
|
|
|
@ -3,8 +3,8 @@ package workflows
|
|||
import (
|
||||
"regexp"
|
||||
|
||||
client "../client"
|
||||
log "../utils/log"
|
||||
client "github.com/pikami/tiktok-dl/client"
|
||||
log "github.com/pikami/tiktok-dl/utils/log"
|
||||
)
|
||||
|
||||
// CanUseDownloadShareLink - Check's if DownloadShareLink can be used
|
||||
|
|
|
@ -5,11 +5,11 @@ import (
|
|||
"regexp"
|
||||
"strings"
|
||||
|
||||
client "../client"
|
||||
config "../models/config"
|
||||
utils "../utils"
|
||||
fileio "../utils/fileio"
|
||||
log "../utils/log"
|
||||
client "github.com/pikami/tiktok-dl/client"
|
||||
config "github.com/pikami/tiktok-dl/models/config"
|
||||
utils "github.com/pikami/tiktok-dl/utils"
|
||||
fileio "github.com/pikami/tiktok-dl/utils/fileio"
|
||||
log "github.com/pikami/tiktok-dl/utils/log"
|
||||
)
|
||||
|
||||
// CanUseDownloadUser - Test's if this workflow can be used for parameter
|
||||
|
|
|
@ -4,12 +4,12 @@ import (
|
|||
"fmt"
|
||||
"regexp"
|
||||
|
||||
client "../client"
|
||||
models "../models"
|
||||
config "../models/config"
|
||||
utils "../utils"
|
||||
fileio "../utils/fileio"
|
||||
log "../utils/log"
|
||||
client "github.com/pikami/tiktok-dl/client"
|
||||
models "github.com/pikami/tiktok-dl/models"
|
||||
config "github.com/pikami/tiktok-dl/models/config"
|
||||
utils "github.com/pikami/tiktok-dl/utils"
|
||||
fileio "github.com/pikami/tiktok-dl/utils/fileio"
|
||||
log "github.com/pikami/tiktok-dl/utils/log"
|
||||
)
|
||||
|
||||
// CanUseDownloadSingleVideo - Check's if DownloadSingleVideo can be used for parameter
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package workflows
|
||||
|
||||
import (
|
||||
config "../models/config"
|
||||
res "../resources"
|
||||
utils "../utils"
|
||||
log "../utils/log"
|
||||
config "github.com/pikami/tiktok-dl/models/config"
|
||||
res "github.com/pikami/tiktok-dl/resources"
|
||||
utils "github.com/pikami/tiktok-dl/utils"
|
||||
log "github.com/pikami/tiktok-dl/utils/log"
|
||||
)
|
||||
|
||||
// StartWorkflowByParameter - Start needed workflow by given parameter
|
||||
|
|
Loading…
Reference in New Issue