Coder Social home page Coder Social logo

tiktokweb's Introduction

TikTokWeb

Show

  • dycookie配置

    image
  • 视频和原声下载(会有原声不可用的情况,app中会遇到,无法直接下载)

    image
  • 图集打包下载功能(自动文件夹+命名)

    image image image 6432df2be8889_6432df2bf0a27

Install

git clone https://github.com/Johnserf-Seed/TikTokWeb.git
cd TikTokWeb
npm i

Run

npm start
http://localhost:4000/

Docker

docker pull johnserfseed/tiktokweb:latest
docker run -d -p 4000:<any port> tiktokweb

访客统计

tiktokweb's People

Contributors

johnserf-seed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tiktokweb's Issues

需要对/node_modules/axios/lib/adapters/http.js的promise加个catch

解析视频时报错
(node:11901) UnhandledPromiseRejectionWarning: Error: Request failed with status code 403
at createError (/home/pi/TiktokWeb/web/node_modules/axios/lib/core/createError.js:16:15)
at settle (/home/pi/TiktokWeb/web/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/home/pi/TiktokWeb/web/node_modules/axios/lib/adapters/http.js:322:11)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:11901) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)

下载的视频不是最高分辨率,部分链接报错

例如readme里的两个示例视频用tool下都是720p的,但是用web下只有540p左右,不知道是不是我填了网页端的ttwid,我在官网上切换分辨率视频的清晰度和猫抓补货的文件大小也没有变化,不知道你们有没有这个问题。
另外部分视频下载报错,但是报错的链接用idm能下载完成:
https://v.douyin.com/iRfMLJbr/
downloadFile.js:38 GET https://v2v12sztpcw02000833spku3vap6ny4va.free-lbv3.idouyinvod.com/v3-cold4.douyinvod.com/7c559343e42f46791e0da24f764f193a/655516c0/video/tos/cn/tos-cn-ve-15c001-alinc2/oANNISQiZPOPwBW3XMAXRAEMt0KQIg2gAiii4/?a=1128&ch=26&cr=3&dr=0&lr=all&cd=0%7C0%7C0%7C3&cv=1&br=280&bt=280&cs=2&ds=6&ft=H4Y7FvvBQOBULry_8Z.BOMzJ4lcMEddK2bL1YHZb8Zmka&mime_type=video_mp4&qs=11&rc=Nzs0OTdmNzdnODw5OTNoOEBpM2Zxb245cmZybDMzNGkzM0BiMjZiYGJiXjAxXy81NC8wYSNlYmUzMmQ0LWpgLS1kLS9zcw%3D%3D&btag=10e000b8001&dy_q=1700070907&feature_id=e585bce62f14c124a0ac1450c3a95af2&l=202311160155077ABD082FF7BDAE42B4BE&ali_redirect_ex_hot=66666800&ali_redirect_ex_beacon=1 net::ERR_FAILED 200 (OK) proceedDownload @ downloadFile.js:38 (anonymous) @ downloadFile.js:66 Promise.then (async) checkFileSizeAndDownload @ downloadFile.js:34 (anonymous) @ downloadFile.js:22 Promise.then (async) downloadFile @ downloadFile.js:19 (anonymous) @ api?url=https://v.douyin.com/iRfMLJbr/:263 dispatch @ jquery.min.js:2 y.handle @ jquery.min.js:2 api:1 Uncaught (in promise) TypeError: Failed to fetch Promise.then (async) proceedDownload @ downloadFile.js:40 (anonymous) @ downloadFile.js:66 Promise.then (async) checkFileSizeAndDownload @ downloadFile.js:34 (anonymous) @ downloadFile.js:22 Promise.then (async) downloadFile @ downloadFile.js:19 (anonymous) @ api?url=https://v.douyin.com/iRfMLJbr/:263 dispatch @ jquery.min.js:2 y.handle @ jquery.min.js:2

点击解析视频报下面这个错误

node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "undefined".] {
code: 'ERR_UNHANDLED_REJECTION'
}

404 走丢啦 这不是你该来的地方

那里的问题?

root@localhost:~/TikTokWeb# npm start http://localhost:4000/

[email protected] start
nodemon ./bin/www "http://localhost:4000/"

[nodemon] 2.0.20
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node ./bin/www http://localhost:4000/
GET / 304 34.103 ms - -
GET /static/stylesheets/milligram.min.css 304 11.155 ms - -
GET /static/stylesheets/progress.css 304 4.214 ms - -
GET /static/stylesheets/unicons.css 304 4.068 ms - -
GET /static/javascripts/jquery.cookie.min.js 200 57.229 ms - 1301
GET /static/javascripts/jquery.min.js 200 53.901 ms - 89795
GET /static/javascripts/jszip.min.js 200 69.167 ms - 97630
GET /static/javascripts/FileSaver.min.js 200 58.540 ms - 2749
GET /static/javascripts/progress.js 200 59.108 ms - 1321
GET /static/fonts/unicons.woff2 200 7.955 ms - 143000
{"odin_tt":"94709eec8aca4ab392e54ba33aced8f191590dd11d625e62493fc2152b1e72174d3f274b2a1e53059921090ad7517d62ae93","passport_csrf_token":"d529c6921bf2090e4192f72d56ac","sessionid_ss":"ad8f2b679ffb4fcc101eab54541432e0\t","ttwid":"verify_lj870qjm_CG0sJlEa_Bo0w_4qG5_BLF8_BaG7u6o3M3RR","msToken":"VF1Vy74v2AeVIEIg6YXlodhMB6P-5BOKVuBxggDSdyNVxRBCJOLtJwgNw_D8er3mEjma3eTuO0SVJlLyh5w=="}
open shorturl ok
作品id 7086787906316094735
https://www.douyin.com/aweme/v1/web/aweme/detail/?aweme_id=7086787906316094735&aid=1128&version_name=23.5.0&device_platform=android&os_version=2333&X-Bogus=DFSzswVuTzGANxXhtn4hKl9WX7jQ
open url ok
GetInfo ok
TypeError: response.data.aweme_detail.desc.replaceAll is not a function
at /root/TikTokWeb/routes/api.js:97:68
at processTicksAndRejections (internal/process/task_queues.js:97:5)
TypeError: response.data.aweme_detail.desc.replaceAll is not a function
at /root/TikTokWeb/routes/api.js:97:68
at processTicksAndRejections (internal/process/task_queues.js:97:5)
GET /api?url=https://v.douyin.com/NKyY6Ch/ 304 20800.254 ms - -
(node:12293) UnhandledPromiseRejectionWarning: ReferenceError: reject is not defined
at GetInfo (/root/TikTokWeb/routes/api.js:127:9)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:12293) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:12293) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
at ServerResponse.setHeader (_http_outgoing.js:530:11)
at ServerResponse.header (/root/TikTokWeb/node_modules/express/lib/response.js:794:10)
at ServerResponse.contentType (/root/TikTokWeb/node_modules/express/lib/response.js:624:15)
at ServerResponse.send (/root/TikTokWeb/node_modules/express/lib/response.js:149:14)
at done (/root/TikTokWeb/node_modules/express/lib/response.js:1035:10)
at tryHandleCache (/root/TikTokWeb/node_modules/ejs/lib/ejs.js:280:5)
at View.exports.renderFile [as engine] (/root/TikTokWeb/node_modules/ejs/lib/ejs.js:491:10)
at View.render (/root/TikTokWeb/node_modules/express/lib/view.js:135:8)
at tryRender (/root/TikTokWeb/node_modules/express/lib/application.js:657:10)
at Function.render (/root/TikTokWeb/node_modules/express/lib/application.js:609:3) {
code: 'ERR_HTTP_HEADERS_SENT'
}
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
at ServerResponse.setHeader (_http_outgoing.js:530:11)
at ServerResponse.header (/root/TikTokWeb/node_modules/express/lib/response.js:794:10)
at ServerResponse.contentType (/root/TikTokWeb/node_modules/express/lib/response.js:624:15)
at ServerResponse.send (/root/TikTokWeb/node_modules/express/lib/response.js:149:14)
at done (/root/TikTokWeb/node_modules/express/lib/response.js:1035:10)
at tryHandleCache (/root/TikTokWeb/node_modules/ejs/lib/ejs.js:280:5)
at View.exports.renderFile [as engine] (/root/TikTokWeb/node_modules/ejs/lib/ejs.js:491:10)
at View.render (/root/TikTokWeb/node_modules/express/lib/view.js:135:8)
at tryRender (/root/TikTokWeb/node_modules/express/lib/application.js:657:10)
at Function.render (/root/TikTokWeb/node_modules/express/lib/application.js:609:3)
GET /static/stylesheets/404.css 304 4.661 ms - -

XX

docker 报错了

waiting for file changes before starting...

ReferenceError: reject is not defined
at GetInfo (F:\New project\TikTokWeb\TikTokWeb\routes\api.js:125:9)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.15.0
[nodemon] app crashed - waiting for file changes before starting...

填写了cookie仍然解析报错

如题,一开始在docker中部署可以正常解析,使用了大概2天后就不行了,解析时提示:抖音的cooki无效,请重新填写
但是我并没有改变任何东西,是什么原因呢?

bower install失败

建议提供一个docker镜像。
系统环境,win10
node 版本:v14.16.1

bower : 无法加载文件 C:\Users\name\AppData\Roaming\npm\bower.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 http
s:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ bower install
+ ~~~~~
    + CategoryInfo          : SecurityError: (:) [],PSSecurityException

item_id 获取错误

F:\TikTokWeb>npm start

[email protected] start
nodemon ./bin/www

[nodemon] 2.0.20
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node ./bin/www
GET / 200 4.803 ms - 8302
open shorturl ok
https://v.douyin.com/6qeBVPV/
https://www.iesdouyin.com/share/user/MS4wLjABAAAA9v-ve_UHoqbKFNoBtQaFzRqRnel0LO5iagq6Azskot8?did=MS4wLjABAAAAAigLg1Dr2-7BHgScPHpIsZCK4rMCIVnWJ88b8HCPmgu3N0Nx-POymp-AtRoW5O-j&iid=MS4wLjABAAAANwkJuWIRFOzg5uCpDRpMj4OX-QryoDgn-yYlXQnRwQQ&with_sec_did=1&sec_uid=MS4wLjABAAAA9v-ve_UHoqbKFNoBtQaFzRqRnel0LO5iagq6Azskot8&from=web_code_link
TypeError: Cannot read properties of null (reading '1') item_ids获取错误
GET /api?url=https://v.douyin.com/6qeBVPV/ 200 999.428 ms - 883
F:\TikTokWeb\routes\api.js:27
next(error)
^

ReferenceError: next is not defined
at F:\TikTokWeb\routes\api.js:27:17
at processTicksAndRejections (node:internal/process/task_queues:96:5)
[nodemon] app crashed - waiting for file changes before starting...

请问这个问题怎么解决?

docker失败

docker: Error response from daemon: pull access denied for tiktokweb, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.

npm start的时候出错

执行npm start后错误提示如下:

$ npm start

[email protected] start
nodemon ./bin/www

[nodemon] 2.0.15
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node ./bin/www
node:internal/modules/cjs/loader:936
throw err;
^

Error: Cannot find module 'http-errors'
Require stack:

  • E:\TikTokDownload-main\TikTokWeb\app.js
  • E:\TikTokDownload-main\TikTokWeb\bin\www
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object. (E:\TikTokDownload-main\TikTokWeb\app.js:1:19)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'E:\TikTokDownload-main\TikTokWeb\app.js',
    'E:\TikTokDownload-main\TikTokWeb\bin\www'
    ]
    }
    [nodemon] app crashed - waiting for file changes before starting...

404

6月28日,使用docker运行,刚开始可以成功解析。后面就不行了,试过换cookie,还是不行。

npm start 出错

root@localhost:~/TikTokWeb# npm start

[email protected] start /root/TikTokWeb
nodemon ./bin/www

/root/TikTokWeb/node_modules/update-notifier/index.js:58
} catch {
^

SyntaxError: Unexpected token {
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object. (/root/TikTokWeb/node_modules/nodemon/bin/nodemon.js:15:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: nodemon ./bin/www
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-04-30T14_09_21_009Z-debug.lo
2022-04-30T13_59_12_853Z-debug.log
g

提个小建议

建议作者放弃对全平台的支持,专注做好一个平台即可。

目前来说,我这边测试下来,只有windows平台是可以正常使用的(但是二维码也是无法扫描,得手动贴cookie),其余平台都无法正常使用。

相较于全平台来说,为大家提供一个稳定可运行的软件更重要。另外,跨平台的问题,可以让用户通过安装虚拟机等解决,确实没有必要耗费太大的精力。

非常感谢作者提供的强大工具

只能解析单个视频无法解析主页

2023-10-5 用新的的docker镜像
解析主页就是 404 走丢了,这不是你该来的地方。
docker日志提示:
URL格式不匹配任何已知模式
Error: Error with status code: 5

长视频无法下载?

示例视频链接:https://v.douyin.com/ieofmV5v/

后台异常如下:

TypeError: Cannot read property 'play_url' of undefined
at GetInfo (D:\Softwares\TikTok\TikTokWeb-main\utils\douyinService.js:78:26)
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at async D:\Softwares\TikTok\TikTokWeb-main\routes\api.js:40:27
GET /api?url=https://v.douyin.com/ieofmV5v/ 500 963.420 ms - 861

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.