pytube: ValueError: too many values to unpack (expected 2)

Ran into this error in my main file i was using.

So i made the most basic version i could and still got that error. Running in python 3.8 64 bit

from pytube import YouTube yt = YouTube('https://www.youtube.com/watch?v=jNQXAC9IVRw')

Error thrown: Traceback (most recent call last): File "c:\Users\user\Documents\My scripting projects\yt download testr\test.py", line 4, in <module> yt = YouTube('https://www.youtube.com/watch?v=jNQXAC9IVRw') File "C:\Python38\lib\site-packages\pytube\__main__.py", line 92, in __init__ self.descramble() File "C:\Python38\lib\site-packages\pytube\__main__.py", line 140, in descramble apply_signature(self.player_config_args, fmt, self.js) File "C:\Python38\lib\site-packages\pytube\extract.py", line 225, in apply_signature cipher = Cipher(js=js) File "C:\Python38\lib\site-packages\pytube\cipher.py", line 31, in __init__ var, _ = self.transform_plan[0].split(".") ValueError: too many values to unpack (expected 2)

Is it just me or are you guys getting this error also?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 34
  • Comments: 41 (4 by maintainers)

Most upvoted comments

I patched and hosted this again. Looks like there was a merge conflict between this PR and #643

You can install directly from my repo like this:

pip install git+https://gitlab.com/obuilds/public/pytube@ob-v2

or add the following to your requirements.txt

git+https://gitlab.com/obuilds/public/pytube@ob-v2

@partriv I had trouble getting it to work too, what worked at the end was uninstalling, pytube3, installing pytubeX and replacing ALL the function patterns (not just the one changed) in cipher.py with the ones in #701 and obviously changing from extract.py in the line 301 the key from “cipher” to “signatureCipher”

Hope this helps 👍

@zuntah thank you.

I use this workaround until bug is fixed:


import os

def download_video(self, video_id):
        url = "https://www.youtube.com/watch?v={}".format(video_id)
        os.system('youtube-dl "{}" --no-check-certificate'.format(url))

You need to install Youtube-DL for that