scrapetube icon indicating copy to clipboard operation
scrapetube copied to clipboard

After YouTube update nothing works

Open Ivolution-dev opened this issue 2 years ago • 10 comments

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

Ivolution-dev avatar Nov 01 '22 19:11 Ivolution-dev

Stopped working for me too.

gsturov avatar Nov 02 '22 21:11 gsturov

Yes I programmed my own now.

Ivolution-dev avatar Nov 02 '22 22:11 Ivolution-dev

@Ivolution-dev What was the problem?

Overkoat avatar Nov 03 '22 01:11 Overkoat

Not working

atknin avatar Nov 03 '22 05:11 atknin

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

dermasmid avatar Nov 03 '22 06:11 dermasmid

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

danielsauceda avatar Nov 03 '22 07:11 danielsauceda

Is it expected behaviour that it only returns "videos" and not livestreams ? @danielsauceda ??

SurajBhari avatar Nov 09 '22 04:11 SurajBhari

Live streams are on a different tab on the website, so they would need a separate endpoint.

parafoxia avatar Nov 09 '22 20:11 parafoxia

Nothing until now?

zoreu avatar Nov 11 '22 19:11 zoreu

We definitely need live streams.

gsturov avatar Nov 11 '22 19:11 gsturov