Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Input Error
#1
Hello,im trying to do a youtube video downloader script,so i did this:
import pytube
video_url = 'https://www.youtube.com/watch?v=4KcMdH8qiuk'
youtube = pytube.YouTube(video_url)
video = youtube.streams.first()
video.download('/home/dream/Downloads')


but i dont want to put the url in the code,I want the user to insert it when the program is started,so i did
import pytube
video_url = input()
youtube = pytube.YouTube(video_url)
video = youtube.streams.first()
video.download('/home/dream/Downloads')
but this return me error:
Error:
Traceback (most recent call last): File "/home/dream/.local/lib/python3.8/site-packages/pytube/extract.py", line 288, in apply_descrambler stream_data[key] = [ File "/home/dream/.local/lib/python3.8/site-packages/pytube/extract.py", line 290, in <listcomp> "url": format_item["url"], KeyError: 'url' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "youtube2.py", line 3, in <module> youtube = pytube.YouTube(video_url) File "/home/dream/.local/lib/python3.8/site-packages/pytube/__main__.py", line 92, in __init__ self.descramble() File "/home/dream/.local/lib/python3.8/site-packages/pytube/__main__.py", line 132, in descramble apply_descrambler(self.player_config_args, fmt) File "/home/dream/.local/lib/python3.8/site-packages/pytube/extract.py", line 300, in apply_descrambler cipher_url = [ File "/home/dream/.local/lib/python3.8/site-packages/pytube/extract.py", line 301, in <listcomp> parse_qs(formats[i]["cipher"]) for i, data in enumerate(formats) KeyError: 'cipher'
Reply


Messages In This Thread
Input Error - by Dream - Jul-12-2020, 01:01 AM
RE: Input Error - by DreamingInsanity - Jul-12-2020, 02:08 PM
RE: Input Error - by bowlofred - Jul-12-2020, 05:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error in Using INPUT statement gunwaba 1 2,017 Jul-03-2022, 10:22 PM
Last Post: deanhystad
Star I'm getting syntax error while using input function in def. yecktmpmbyrv 1 1,932 Oct-06-2021, 09:39 AM
Last Post: menator01
  Pyspark SQL Error - mismatched input 'FROM' expecting <EOF> Ariean 3 47,838 Nov-20-2020, 03:49 PM
Last Post: Ariean
  EOF error while taking input ShishirModi 1 2,535 Sep-27-2020, 11:28 AM
Last Post: jefsummers
  Getting an error while using input function dcsethia 5 2,858 May-11-2020, 04:59 PM
Last Post: buran
  catch input type error mcmxl22 5 2,971 Aug-11-2019, 07:33 AM
Last Post: wavic
  inserting input gives me error message RubberNuggets 3 2,505 Jan-15-2019, 06:17 PM
Last Post: buran
  an input error or elif error , how can i fix this the_fire_pharaoh 1 2,326 Dec-15-2018, 09:47 PM
Last Post: Gribouillis
  Getting Error : User Input aankrose 1 2,978 Sep-06-2018, 04:55 PM
Last Post: buran
  Input error vijays3 1 2,578 May-30-2018, 08:50 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020