scrapetube
scrapetube copied to clipboard
After YouTube update nothing works
After the lastest update i can't get videos from a channel
video_generator = scrapetube.get_channel(channel_id=channel_id, limit=5, sort_by="newest")
The generator gives an empty array
Stopped working for me too.
Yes I programmed my own now.
@Ivolution-dev What was the problem?
Not working
i pushed a fix, but i saw that some of the other stuff like sorting does not work anymore, ill try to fix it on the weekend
Alright everyone I have a fix for you. @dermasmid you can use my fix to help yourself they just made changes to the JSON structure
First of all in the source code this change needs to be added
in the scrapetube file C:\ProgramData\Anaconda3\envs\py38\lib\site-packages\scrapetube\scrapetube.py
def get_channel( )
...
....
# videos = get_videos(url, api_endpoint, "gridVideoRenderer", limit, sleep)
videos = get_videos(url, api_endpoint, "richItemRenderer", limit, sleep)
Howerver this changes the output path of the dict so you have to do it this way
for vid in videos:
# print("https://www.youtube.com/watch?v=" + str(vid['videoId']))
print("https://www.youtube.com/watch?v=" + str(vid['content']['videoRenderer']['videoId']))
I'm sure in the source code you could squish down the results dict so it repoints to to just videoId
.... but this worked for me
@Ivolution-dev this is a short fix. hope it helps
edit: if no one upvotes I'm going to tell on you Majj
Is it expected behaviour that it only returns "videos" and not livestreams ? @danielsauceda ??
Live streams are on a different tab on the website, so they would need a separate endpoint.
Nothing until now?
We definitely need live streams.