HTTP 404 error on some streams
See original GitHub issueversion 9.5.1 I have 404 error on some streams from this video, and many other (1/10 of all videos from my big list), after download()
yt = YouTube('https://www.youtube.com/watch?v=8GPULK6XYhU')
[<Stream: itag="22" mime_type="video/mp4" res="720p" fps="30fps" vcodec="avc1.64001F" acodec="mp4a.40.2">,
<Stream: itag="43" mime_type="video/webm" res="360p" fps="30fps" vcodec="vp8.0" acodec="vorbis">,
<Stream: itag="18" mime_type="video/mp4" res="360p" fps="30fps" vcodec="avc1.42001E" acodec="mp4a.40.2">,
<Stream: itag="137" mime_type="video/mp4" res="1080p" fps="30fps" vcodec="avc1.64001e">,
<Stream: itag="248" mime_type="video/webm" res="1080p" fps="30fps" vcodec="vp9">,
<Stream: itag="136" mime_type="video/mp4" res="720p" fps="30fps" vcodec="avc1.4d4016">...]
For example, first one is ok, but 4 and 6 are not. This is bug or something youtube related?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
404 Page Not Found Error: What It Is and How to Fix It - Lifewire
The 404 Not Found error, also called Error 404 or an HTTP 404 error, means that the web page you were trying to...
Read more >What Is a 404 Error? How to Deal With the Web Error
A 404 error indicates that the webpage you're trying to reach can't be found, and usually means that the page has moved or...
Read more >What Is a 404 Not Found Error? - Reviews.org
When you see a 404 Not Found error, it simply means that your computer is trying to access information on a page that...
Read more >404 Page Not Found Error: What It Is and How to Fix It
The 404 Not Found error, also called Error 404 or an HTTP 404 error, means that the web page you were trying to...
Read more >Server retured 404 not found · Issue #167 · xteve-project/xTeVe
Some streams return a 404 error while run thru Xteve. ... With Curl you can check every HTTP connection, including your streaming URLs....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@JuraPal I was reading through one of the previous issues, and the 403 problem has been fixed. The fix brings up a regex error, but that has also been fixed.
fixing 403: change line 42 and below to:
`if (‘signature=’ in url or (‘s’ not in stream and (‘&sig=’ in url or ‘&lsig=’ in url))): # For certain videos, YouTube will just provide them pre-signed, in # which case there’s no real magic to download them and we can skip # the whole signature descrambling entirely. logger.debug(‘signature found, skip decipher’) continue
This fixes the 403 error. Next issue is a regex problem.
Go to cipher.py and change line 38 to:
pattern = [ r'\b[cs]\s*&&\s*[adf]\.set\([^,]+\s*,\s*encodeURIComponent\s*\(\s*(?P<sig>[a-zA-Z0-9$]+)\(', r'\b[a-zA-Z0-9]+\s*&&\s*[a-zA-Z0-9]+\.set\([^,]+\s*,\s*encodeURIComponent\s*\(\s*(?P<sig>[a-zA-Z0-9$]+)\(', r'(?P<sig>[a-zA-Z0-9$]+)\s*=\s*function\(\s*a\s*\)\s*{\s*a\s*=\s*a\.split\(\s*""\s*\)', r'(["\'])signature\1\s*,\s*(?P<sig>[a-zA-Z0-9$]+)\(', r'\.sig\|\|(?P<sig>[a-zA-Z0-9$]+)\(', r'yt\.akamaized\.net/\)\s*\|\|\s*.*?\s*[cs]\s*&&\s*[adf]\.set\([^,]+\s*,\s*(?:encodeURIComponent\s*\()?\s*(?P<si$', r'\b[cs]\s*&&\s*[adf]\.set\([^,]+\s*,\s*(?P<sig>[a-zA-Z0-9$]+)\(', r'\b[a-zA-Z0-9]+\s*&&\s*[a-zA-Z0-9]+\.set\([^,]+\s*,\s*(?P<sig>[a-zA-Z0-9$]+)\(', r'\bc\s*&&\s*a\.set\([^,]+\s*,\s*\([^)]*\)\s*\(\s*(?P<sig>[a-zA-Z0-9$]+)\(', r'\bc\s*&&\s*[a-zA-Z0-9]+\.set\([^,]+\s*,\s*\([^)]*\)\s*\(\s*(?P<sig>[a-zA-Z0-9$]+)\(', r'\bc\s*&&\s*[a-zA-Z0-9]+\.set\([^,]+\s*,\s*\([^)]*\)\s*\(\s*(?P<sig>[a-zA-Z0-9$]+)\(' ]
This should fix the current issues.
pytube-10.8.5
got the fix in my machine