Giter Site home page Giter Site logo

pablouser1 / signtok Goto Github PK

View Code? Open in Web Editor NEW
55.0 4.0 24.0 261 KB

Sign TikTok URLs without using a headless browser

Home Page: https://signtok.pabloferreiro.es

License: MIT License

Procfile 0.31% Dockerfile 8.16% JavaScript 91.53%
tiktok-api tiktok-signature

signtok's Introduction

SignTok

Sign your TikTok urls easily. This is a port of tiktok-signature using JSDOM

This project allows signing TikTok urls without having to run a headless browser, which lowers ram usage a lot.

Deploy

Installation

Docker

docker pull ghcr.io/pablouser1/signtok:master

Now you can create a container with:

docker run --publish 8080:8080 ghcr.io/pablouser1/signtok:master

Manual

yarn install

Now you can run the server with:

node api/index.js

Usage

Webserver

You can send a POST request to http://localhost:8080/signature with a raw/plain body containing the url

(Content-Type: text/plain)

If you plan to use the already deployed Vercel version, you should use https://signtok.vercel.app/api/signature

You can see some examples here

Cli

node local.js 'YOUR_URL_HERE'

Library

npm install signtok
const SignTok = require('signtok');

const signer = new SignTok();
console.log(signer.sign('URL_HERE'));

TODO

  • Typescript typing
  • Publish to npm with Github Actions

Credits

  • @H1W0XXX for providing a working X-Bogus script

signtok's People

Contributors

fariszr avatar pablouser1 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

Watchers

 avatar  avatar  avatar  avatar

signtok's Issues

Where did the cipher password come from

Hi, sorry for opening an issue for this, but I found your tool super useful and would like to start using it. Sadly, I've been struggling with TikTok scraping and their constant changes and obstacles, so I'd like to know where this comes from, so I can trust that it can be found again whenever they choose to update it:

src/Signer.js: line 9

  static PASSWORD = 'webapp1.0+202106'

Thanks a lot!!

Error: /lib64/libz.so.1:

i try to deploy to vercel, but got this error

[POST] /api/signatur
12:44:40:19

2022-08-31T10:44:41.054Z undefined ERROR Error: /lib64/libz.so.1: version `ZLIB_1.2.9' not found (required by /var/task/node_modules/canvas/build/Release/libpng16.so.16) at Object.Module._extensions..node (node:internal/modules/cjs/loader:1189:18) 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) at require (node:internal/modules/cjs/helpers:102:18) at Object. (/var/task/node_modules/canvas/lib/bindings.js:3:18) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) { code: 'ERR_DLOPEN_FAILED'}RequestId: 57525d4b-dc05-483f-9b28-9f0533673e3d Error: Runtime exited with error: exit status 1Runtime.ExitError

tried to change package.json
by replace
"start": "node api/index.js",
with
"start": "LD_PRELOAD='/opt/app-root/src/node_modules/sharp/vendor/lib/libz.so' node api/index.js","
but same problem..
any help

how to use

is this code correct?

(import requests

headers = {
    user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36',
    'body': 'tiktok url',

}
u="https://signtok.vercel.app:8080/signature"

r = requests.post(u, headers=headers)
print(r)
print(r.text)
#print(r.json()))

because it gave error connection closed...

is this working with the new tiktok api?
is there any demo at Heroku or similar?

update x bogus

can you please update x bogus with new algorithm

https://github.com/angelillija/X-Bogus

Proxy Support

Is there a way to use this library with a proxy to make the required request to TikTok

musicfeed url

Thanks for the great work,
i am wondering if you know the correct music feed URL parameters , i can sign the url but can't get it to work, it always give me this error

{'statusCode': 10201, 'statusMsg': 'missing required fields...'}

i tried all those URL

data = 'https://m.tiktok.com/api/music/item_list/?aid=1988&app_language=en&app_name=tiktok_web&battery_info=1&browser_language=en-US&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36&channel=tiktok_web&cookie_enabled=true&device_id={}&device_platform=web_pc&focus_state=true&from_page=music&history_len=4&is_fullscreen=false&is_page_visible=true&os=windows&priority_region=&referer=&region={}&screen_height=480&screen_width=854&tz_name=Etc/GMT-2&webcast_language=en&msToken={}&X-Bogus={}&_signature={}&verifyFp={}&cursor={}&count={}&musicId={}&shareUid=&secUid=&type=4&minCursor=0&maxCursor=0&id={}'.format(device_id, region, msToken, Bogus, signature, verify, cursor, count, musicId, minCursor, maxCursor, id)

data = 'https://m.tiktok.com/api/music/item_list/?aid=1988&app_language=en&app_name=tiktok_web&battery_info=1&browser_language=en-US&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36&channel=tiktok_web&cookie_enabled=true&device_id={}&device_platform=web_pc&focus_state=true&from_page=music&history_len=4&is_fullscreen=false&is_page_visible=true&os=windows&priority_region=&referer=&region={}&screen_height=480&screen_width=854&tz_name=Etc/GMT-2&webcast_language=en&msToken={}&X-Bogus={}&_signature={}&verifyFp={}&cursor={}&count={}&musicId={}&shareUid=&secUid=&type=4.format(device_id, region, msToken, Bogus, signature, verify, cursor, count, musicId)

data = 'https://m.tiktok.com/api/music/item_list/?aid=1988&app_language=en&app_name=tiktok_web&battery_info=1&browser_language=en-US&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36&channel=tiktok_web&cookie_enabled=true&device_id={}&device_platform=web_pc&focus_state=true&from_page=music&history_len=4&is_fullscreen=false&is_page_visible=true&os=windows&priority_region=&referer=&region={}&screen_height=480&screen_width=854&tz_name=Etc/GMT-2&webcast_language=en&msToken={}&X-Bogus={}&_signature={}&verifyFp={}&cursor={}&count={}&id={}&shareUid=&secUid=&type=4.format(device_id, region, msToken, Bogus, signature, verify, cursor, count, id)


data = 'https://m.tiktok.com/api/music/item_list/?aid=1988&app_language=en&app_name=tiktok_web&battery_info=1&browser_language=en-US&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36&channel=tiktok_web&cookie_enabled=true&device_id={}&device_platform=web_pc&focus_state=true&from_page=music&history_len=4&is_fullscreen=false&is_page_visible=true&os=windows&priority_region=&referer=&region={}&screen_height=480&screen_width=854&tz_name=Etc/GMT-2&webcast_language=en&msToken={}&X-Bogus={}&_signature={}&verifyFp={}&count={}&musicId={}&shareUid=&secUid=&type=4&minCursor=0&maxCursor=0&id={}'.format(device_id, region, msToken, Bogus, signature, verify,  count, minCursor, maxCursor, id)

data = 'https://m.tiktok.com/api/music/item_list/?aid=1988&app_language=en&app_name=tiktok_web&battery_info=1&browser_language=en-US&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36&channel=tiktok_web&cookie_enabled=true&device_id={}&device_platform=web_pc&focus_state=true&from_page=music&history_len=4&is_fullscreen=false&is_page_visible=true&os=windows&priority_region=&referer=&region={}&screen_height=480&screen_width=854&tz_name=Etc/GMT-2&webcast_language=en&msToken={}&X-Bogus={}&_signature={}&verifyFp={}&count={}&musicId={}&shareUid=&secUid=&type=4&minCursor=0&maxCursor=0&musicId={}'.format(device_id, region, msToken, Bogus, signature, verify,  count, minCursor, maxCursor, musicId)

as you can see i tried

  • id and musicid
  • count, minCursor, maxCursor,
  • cursor, count,

using chrome to fetch api get parameter plus x-tt-params and i can fetch the data successfully now using the same parameter with different sound id to sign the URL and try to fetch the data tiktok API response always

missing required fields..

which mean the URL that i signed have miss parameters!
any help will be appreciated

SIgn URL Not working

When i get a Sign link from https://signtok.pabloferreiro.es probally this is not working for me
i manually enter this in Firefox and chrome browser both
can you help how i can get API response from this signurl
looking forward any working solution

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.