Open Shardyn opened 10 months ago
TikTok makes it extra difficult to record age restricted live streams. I haven't been able to get that working yet. The error message is currently only there to let the user know why the recording has failed.
I just got the same error. When opening the JSON file in the browser, I can still get the URL.
TikTok makes it extra difficult to record age restricted live streams. I haven't been able to get that working yet. The error message is currently only there to let the user know why the recording has failed.
Ah ok, makes sense
Does anyone know of any age restricted creators that go live regularly? So I can test and possibly fix the issue. The one I was using previously does not go live any more.
chaotically_dani1 is live almost every day and night and gets age restricted for vaping all day long.
chaotically_dani1 is live almost every day and night and gets age restricted for vaping all day long.
I just tried recording that one and got no error. Maybe age restriction got fixed when we had to add cookies.
It's only got age restricted on one live if he/she close and open again it's remove
I made hot fix by adding cookies extracted from browser (from "Cookie Quick Manager" for Firefox). I edited tiktok_bot.py:
import json as jsonread
# Read the cookies data from the JSON file
with open('cookies.json', 'r') as file:
cookies_data = jsonread.load(file)
# Parse the cookies
cookies = {}
for cookie in cookies_data:
cookies[cookie['Name raw']] = cookie['Content raw']
# edit those lines:
# json = req.get(url, headers=bot_utils.headers).json()
#like that:
json = self.req.get(url, headers=bot_utils.headers, cookies=cookies).json()
I didn't like that mechanism of getting cookies through the browser exec anyway. I don't know much Python or GIT. Adding a new parameter and Git commit will take me a while unless someone fixes it properly.
I made hot fix by adding cookies extracted from browser (from "Cookie Quick Manager" for Firefox). I edited tiktok_bot.py:
import json as jsonread # Read the cookies data from the JSON file with open('cookies.json', 'r') as file: cookies_data = jsonread.load(file) # Parse the cookies cookies = {} for cookie in cookies_data: cookies[cookie['Name raw']] = cookie['Content raw'] # edit those lines: # json = req.get(url, headers=bot_utils.headers).json() #like that: json = self.req.get(url, headers=bot_utils.headers, cookies=cookies).json()
I didn't like that mechanism of getting cookies through the browser exec anyway. I don't know much Python or GIT. Adding a new parameter and Git commit will take me a while unless someone fixes it properly.
Can you make a video tutorial?I'm very stupid to this
I made hot fix by adding cookies extracted from browser (from "Cookie Quick Manager" for Firefox). I edited tiktok_bot.py:
import json as jsonread # Read the cookies data from the JSON file with open('cookies.json', 'r') as file: cookies_data = jsonread.load(file) # Parse the cookies cookies = {} for cookie in cookies_data: cookies[cookie['Name raw']] = cookie['Content raw'] # edit those lines: # json = req.get(url, headers=bot_utils.headers).json() #like that: json = self.req.get(url, headers=bot_utils.headers, cookies=cookies).json()
I didn't like that mechanism of getting cookies through the browser exec anyway. I don't know much Python or GIT. Adding a new parameter and Git commit will take me a while unless someone fixes it properly.
Hi, do you mind doing a quick step by step, I'm slow when it comes to this lol.
This was quick fix with hard coded cookies. I am considering adding this option as an argument and passing the cookie path in it. Unfortunately, I don't know python very well. And I haven't had time for it yet.
This was quick fix with hard coded cookies. I am considering adding this option as an argument and passing the cookie path in it. Unfortunately, I don't know python very well. And I haven't had time for it yet.
Hey, @zadrakar! Can you drop the entire code file with your hotfix? That "age restricted" keeps popping up, and the browser exstention ain't cutting it. Can you share the full code somewhere? Maybe on Pastebin or here?
Ah, I figured it out. I used Google Chrome along with the "Cookie Manager" extension to export the cookies. Place the JSON file that you export using the extension in the root of the repository.
Still getting age restricted even with @zadrakar cookie hot fix
Still getting age restricted even with @zadrakar cookie hot fix
@Marksmanship256 The cookies method is working for me, perhaps something else is wrong in your set up. Are you running with the browser_exec flag? If so, the code will try to grab the link using browser extension rather than the json query you changed on your screenshot. Try these things:
And if it sitll doesn't work despite that, try logging on tiktok on Firefox browser and extract those cookies. Maybe there is something in Chromium based browsers that prevents it from working, despite it working with Firefox cookies.
I got this issue again a few days ago after not seeing it for very long. I saw on another github page that If cookies no longer works it seems you have to create a new account and extract cookies from there. This seems to work for me.
Is there a way to remove the age restriction error from the code? TikTok deems some "violent" video game streams to be age restricted so the recorder won't let me record them.