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.

Unable to extract full playlist

See original GitHub issue
from pytube import Playlist

url = 'https://www.youtube.com/playlist?list=PL9bw4S5ePsEF-J_tIORZ6xE_OXkGuKjjY'
playlist = Playlist(url)

print(len(playlist.video_urls))

print(type(playlist.video_urls))
for url in playlist.video_urls:
    print(url)

Traceback (most recent call last): File “E:/Practice/testing.py”, line 6, in <module> print(len(playlist.video_urls)) File “C:\Python\Python 3.7\lib\site-packages\pytube\contrib\playlist.py”, line 242, in video_urls for page in list(self._paginate()) File “C:\Python\Python 3.7\lib\site-packages\pytube\contrib\playlist.py”, line 111, in _paginate req = request.get(load_more_url, extra_headers=headers) TypeError: get() got an unexpected keyword argument ‘extra_headers’

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mpritampcommented, Aug 20, 2020

@jayathungek Thank you so much, After reinstall it worked. Really thanks a lot.

0reactions
jayathungekcommented, Aug 20, 2020

@mpritamp I’ve done some checking and it looks like theres 2 problems:

  1. Some videos in that playlist are duplicates, so it appears that pytube skips them, resulting in fewer videos than you expect.
  2. Youtube playlists over 100 videos long require multiple GET requests to load all of them. And naturally, since you removed the extra_headers argument, pytube is not able to request any more videos past the first 100, of which some are duplicates. Hence your unexpected value of 94 videos.

Again, I think you should uninstall pytube completely and reinstall it using the command in my previous comment. This should fix it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Save a copy of your playlists in iTunes on PC - Apple Support
Save a copy of a single playlist or use it in iTunes on another computer: Select the playlist in the sidebar on the...
Read more >
Problems downloading playlist using youtube-dl - Ask Ubuntu
I got message that the youtube-dl have to be updated when I try to download a playlist from youtube when I try to...
Read more >
Beautifulsoup is unable to extract all html - Stack Overflow
I tried to create a program to extract all the songs from my Daily Mix ... that I have to use but I...
Read more >
Age-restricted videos generic error "Unable to extract ... - Reddit
ExtractorError: ae5A_d3dVSo: YouTube said: Unable to extract video data ... yt-dlp keeps downloading the entire playlist when I only want a ...
Read more >
Ubuntu Manpage: youtube-dl
--flat-playlist Do not extract the videos of a playlist, only list them. ... If the URL refers to a playlist, dump the whole...
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