Comments (9)
#x_csrf_token = r.headers["X-Ware-Csrf-Token"].split(',')[1]
params = {
"video_id":video_id,
"visibility_type":"0",
"poster_delay":"0",
"text":text,
"text_extra":json.dumps(text_extra),
"allow_comment":"1",
"allow_duet":"0",
"allow_stitch":"0",
"sound_exemption":"0",
"aid":"1988",
}
if schedule_time:
params["schedule_time"] = schedule_time
#headers = {"X-Secsdk-Csrf-Token": x_csrf_token}
You need to remove this line of code
from tiktok-uploader.
same here. got this from chatgpt:
The error you're encountering is a KeyError raised at the line x_csrf_token = r.headers["X-Ware-Csrf-Token"].split(',')[1] in the uploadVideo function. This error occurs because the "X-Ware-Csrf-Token" header is not present in the response returned by the TikTok server, and the code is trying to access it.
The "X-Ware-Csrf-Token" header is typically used for CSRF (Cross-Site Request Forgery) protection. If the TikTok server has changed its response structure or if there is an issue with the request or authentication, this header might not be included in the response.
To fix this issue, you can add a check to ensure that the "X-Ware-Csrf-Token" header is present before accessing it. Modify the line as follows:
python
Copy code
x_csrf_token = r.headers.get("X-Ware-Csrf-Token", "").split(',')[1]
By using the get() method of the headers dictionary, you can provide a default value (in this case, an empty string) if the header is not found. This way, if the header is missing, x_csrf_token will be an empty string, and the code will continue to execute without raising a KeyError. However, you should make sure to handle the case when the CSRF token is missing appropriately in your code.
After making this change, try running your code again, and see if the issue is resolved. If there are other issues or errors, further debugging might be necessary to identify and address them.
from tiktok-uploader.
I think this is not going to work because the header field seems not to be present anymore. Were you successful on reactivating the script?
from tiktok-uploader.
Just tested this and sadly it is not working.
from tiktok-uploader.
Is there any other fix?
from tiktok-uploader.
#x_csrf_token = r.headers["X-Ware-Csrf-Token"].split(',')[1] params = { "video_id":video_id, "visibility_type":"0", "poster_delay":"0", "text":text, "text_extra":json.dumps(text_extra), "allow_comment":"1", "allow_duet":"0", "allow_stitch":"0", "sound_exemption":"0", "aid":"1988", } if schedule_time: params["schedule_time"] = schedule_time #headers = {"X-Secsdk-Csrf-Token": x_csrf_token}You need to remove this line of code
It works, but when file is uploaded to tiktok, then it doesn't has any audio
from tiktok-uploader.
#x_csrf_token = r.headers["X-Ware-Csrf-Token"].split(',')[1] params = { "video_id":video_id, "visibility_type":"0", "poster_delay":"0", "text":text, "text_extra":json.dumps(text_extra), "allow_comment":"1", "allow_duet":"0", "allow_stitch":"0", "sound_exemption":"0", "aid":"1988", } if schedule_time: params["schedule_time"] = schedule_time #headers = {"X-Secsdk-Csrf-Token": x_csrf_token}You need to remove this line of code
It works, but when file is uploaded to tiktok, then it doesn't has any audio
In browser it shows that video is uploaded, but without sound, but from other devices you can't see this video
from tiktok-uploader.
#x_csrf_token = r.headers["X-Ware-Csrf-Token"].split(',')[1] params = { "video_id":video_id, "visibility_type":"0", "poster_delay":"0", "text":text, "text_extra":json.dumps(text_extra), "allow_comment":"1", "allow_duet":"0", "allow_stitch":"0", "sound_exemption":"0", "aid":"1988", } if schedule_time: params["schedule_time"] = schedule_time #headers = {"X-Secsdk-Csrf-Token": x_csrf_token}You need to remove this line of code
It works, but when file is uploaded to tiktok, then it doesn't has any audio
In browser it shows that video is uploaded, but without sound, but from other devices you can't see this video
I uploaded successfully and it is with sound, I can only log in to tiktok through the browser no other device
from tiktok-uploader.
But you didn't add a pull request, here ;( I'm gonna do a retest and then create a pull request. Maybe we get this thing back on track.
from tiktok-uploader.
Related Issues (20)
- Problem in Container HOT 2
- how to automatically upload every # secounds
- Images ??
- can you help me?
- What is this URL? What's its purpose? HOT 2
- user_id_str is nor defined HOT 3
- KeyError: 'x-ware-csrf-token' HOT 4
- Contact me, i want to talk to you about something
- multiple videos
- An error occured while reaching https://www.tiktok.com/api/v1/item/create/ HOT 7
- Uploads have no Cover Thumbnail
- How to fix this error?
- Videos Published as "Public" Are Only Visible to the User's Account HOT 4
- I upload one or two videos and then I keep getting this error. HOT 2
- Does This Script Still Work?
- The Script doesn't work, "invalid parameters"
- Invalid Parameters HOT 3
- Error with "https://vod-us-east-1.bytevcloudapi.com/" session HOT 2
- The 'project' key is not present in the response. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tiktok-uploader.