question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possible new issue with autogenerated channel upload playlists

See original GitHub issue

Description When using an autogenerated Youtube channel playlist (go to channel, videos tab, click or copy the ‘Play all’ button next to ‘Uploads’ to get the URL), a 410 error is received. This behavior began sometime after Feb 18th. Normal playlists behave as expected.

Repro

def DownloadChannel(channel_link):
    list_videos = Playlist(channel_link).video_urls
    total_videos = len(list_videos)
    print(f'{total_videos} Videos Found')


DownloadChannel(channel_link="https://www.youtube.com/playlist?list=UUAuUUnT6oDeKwE6v1NGQxug&playnext=1&index=1")  # TED channel uploads playlist

Expected behavior Receive the data from the playlist.

Output

C:\Python38\python.exe D:/dsl_addons/personal_dev/Python/misc/youtube_presentation/v2.py
Traceback (most recent call last):
  File "D:/dsl_addons/personal_dev/Python/misc/youtube_presentation/v2.py", line 124, in <module>
    DownloadChannel(channel_link="https://www.youtube.com/playlist?list=UUAuUUnT6oDeKwE6v1NGQxug&playnext=1&index=1")
  File "D:/dsl_addons/personal_dev/Python/misc/youtube_presentation/v2.py", line 11, in DownloadChannel
    list_videos = Playlist(pure_link).video_urls
  File "C:\Python38\lib\site-packages\pytube\contrib\playlist.py", line 212, in video_urls
    for page in list(self._paginate())
  File "C:\Python38\lib\site-packages\pytube\contrib\playlist.py", line 78, in _paginate
    req = request.get(load_more_url, extra_headers=headers)
  File "C:\Python38\lib\site-packages\pytube\request.py", line 42, in get
    return _execute_request(url, headers=extra_headers).read().decode("utf-8")
  File "C:\Python38\lib\site-packages\pytube\request.py", line 26, in _execute_request
    return urlopen(request)  # nosec
  File "C:\Python38\lib\urllib\request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Python38\lib\urllib\request.py", line 531, in open
    response = meth(req, response)
  File "C:\Python38\lib\urllib\request.py", line 640, in http_response
    response = self.parent.error(
  File "C:\Python38\lib\urllib\request.py", line 569, in error
    return self._call_chain(*args)
  File "C:\Python38\lib\urllib\request.py", line 502, in _call_chain
    result = func(*args)
  File "C:\Python38\lib\urllib\request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 410: Gone

Process finished with exit code 1

System information

  • Python version: 3.8.2
  • Pytube version: 10.4.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
dslyecxicommented, Apr 12, 2021

Updating fixed it. I’d mistakenly thought I was up to date, but now I see what I missed. Thanks for your help!

0reactions
tfdahlincommented, May 3, 2021

@chanstev I think your python installation is using the wrong version of pytube on your system, which may be an issue with your PATH variable, or it could be due to conflicting python installations.

If you note in the error message you received, it says that line 212 should be for page in list(self._paginate()). However, if you look at line 212 in the pytube/contrib/playlist.py file for v10.7.2, this does not match.

Sometimes this kind of thing happens when you previously installed an older version of python, then later install a new version, where pip will install things incorrectly, or python will try to import from the wrong directory.

To try and fix this, I would first try to fully uninstall pytube and reinstall it. Sometimes people have alternative versions of pytube, such as pytube3 or pytubex, so I usually recommend running the following command to have the best chance of success: python -m pip uninstall pytube pytube3 pytubex. Then, you can reinstall with python -m pip install pytube.

If that doesn’t work, you might try checking your path variables to see if they’re configured correctly to access the correct folders. It looks like your path variables are accessing a 3.8 installation, but maybe you’ve upgraded to 3.9 at some point (or downgraded to 3.7?), which would indicate that pip installations are going to the wrong spot, or python is accessings from the wrong spot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

My music is on another artist's topic channel. How do I fix this?
I recently used Distrokid to release an EP under my stage name, "LTrain." Unfortunately, when my songs were auto-generated by YouTube, ...
Read more >
YouTube Topic Channels - Help Articles
These are channels auto-generated by YouTube, so there's no way to gain access, edit, or delete them. Their main purpose is to help...
Read more >
YouTube - Claiming & Merging Artist Topic Channels with ...
All music appearing on the topic channel will be moved/merged to your own/official YouTube page. You won't lose any plays on the videos...
Read more >
What's the deal with the "Auto-Generated by Youtube" songs?
The downside to this is if you don't continue paying for premium, they pull all the channels on youtube and any other platform...
Read more >
Do the Auto Generated YouTube Music Videos count towards ...
This is a SUPER specific video: Do the Auto Generated YouTube Music Videos count towards watch hours for the YouTube Partner Program?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found