Pytube: Key Error: Cipher, Key Error url

Created on 3 Jun 2020  路  1Comment  路  Source: pytube/pytube

```Traceback (most recent call last):
File "C:\Users\Ahnaf\Desktop\Ydn\venv\lib\site-packages\pytube\extract.py", line 288, in apply_descrambler
stream_data[key] = [
File "C:\Users\Ahnaf\Desktop\Ydn\venv\lib\site-packages\pytube\extract.py", line 290, in
"url": format_item["url"],
KeyError: 'url'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/Ahnaf/Desktop/Ydn/test2.py", line 3, in
yt = YouTube('https://www.youtube.com/watch?v=TME8EQrifgc&list=RDTME8EQrifgc&start_radio=1')
File "C:\Users\Ahnaf\Desktop\Ydn\venv\lib\site-packages\pytube__main__.py", line 92, in __init__
self.descramble()
File "C:\Users\Ahnaf\Desktop\Ydn\venv\lib\site-packages\pytube__main__.py", line 132, in descramble
apply_descrambler(self.player_config_args, fmt)
File "C:\Users\Ahnaf\Desktop\Ydn\venv\lib\site-packages\pytube\extract.py", line 300, in apply_descrambler
cipher_url = [
File "C:\Users\Ahnaf\Desktop\Ydn\venv\lib\site-packages\pytube\extract.py", line 301, in
parse_qs(formats[i]["cipher"]) for i, data in enumerate(formats)
KeyError: 'cipher'```

Most helpful comment

It works for me after changing following line inside the file
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pytube/extract.py

Around line 301, inside the except KeyError::
parse_qs(formats[i]["signatureCipher"]) for i, data in enumerate(formats)

>All comments

It works for me after changing following line inside the file
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pytube/extract.py

Around line 301, inside the except KeyError::
parse_qs(formats[i]["signatureCipher"]) for i, data in enumerate(formats)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

murdak picture murdak  路  5Comments

ryze312 picture ryze312  路  3Comments

robly18 picture robly18  路  6Comments

dreamingbinary picture dreamingbinary  路  3Comments

HariharanVSM picture HariharanVSM  路  3Comments