prokunal / Smart-Youtube-Playlist-Downloader

Download all videos from YouTube playlist with 4 threading to download super fast
23 stars 11 forks source link

bro i stared u and followed but after adding feature now its not even downloading anything its showing so many errors pls. help me #2

Closed amandalal007 closed 2 years ago

amandalal007 commented 2 years ago

┌──(sad㉿Demon)-[~/Downloads/Smart-Youtube-Playlist-Downloader] └─$ python3 yt_playlist_downloader.py https://youtube.com/playlist?list=PL8828Z-IEhFG_QgwPiyAF2PvEqBO6aq3p Playlist Name : Business Model Series Channel Name : Dhruv Rathee Total Videos : 7 Total Views : 39157 Downloading Started...

Exception in thread d1: Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 910, in run self._target(*self._args, self._kwargs) File "/home/sad/Downloads/Smart-Youtube-Playlist-Downloader/yt_playlist_downloader.py", line 38, in downloader1 ys = yt.streams.get_highest_resolution() File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 292, in streams return StreamQuery(self.fmt_streams) File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 177, in fmt_streams extract.apply_signature(stream_manifest, self.vid_info, self.js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/extract.py", line 409, in apply_signature cipher = Cipher(js=js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 43, in init self.throttling_plan = get_throttling_plan(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 387, in get_throttling_plan raw_code = get_throttling_function_code(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 301, in get_throttling_function_code code_lines_list = find_object_from_startpoint(js, match.span()[1]).split('\n') AttributeError: 'NoneType' object has no attribute 'span' Exception in thread d3: Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 910, in run self._target(*self._args, *self._kwargs) File "/home/sad/Downloads/Smart-Youtube-Playlist-Downloader/yt_playlist_downloader.py", line 52, in downloader3 ys = yt.streams.get_highest_resolution() File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 292, in streams return StreamQuery(self.fmt_streams) File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 177, in fmt_streams extract.apply_signature(stream_manifest, self.vid_info, self.js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/extract.py", line 409, in apply_signature cipher = Cipher(js=js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 43, in init self.throttling_plan = get_throttling_plan(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 387, in get_throttling_plan raw_code = get_throttling_function_code(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 301, in get_throttling_function_code code_lines_list = find_object_from_startpoint(js, match.span()[1]).split('\n') AttributeError: 'NoneType' object has no attribute 'span' Exception in thread d4: Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 910, in run self._target(self._args, self._kwargs) File "/home/sad/Downloads/Smart-Youtube-Playlist-Downloader/yt_playlist_downloader.py", line 59, in downloader4 ys = yt.streams.get_highest_resolution() File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 292, in streams return StreamQuery(self.fmt_streams) File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 177, in fmt_streams extract.apply_signature(stream_manifest, self.vid_info, self.js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/extract.py", line 409, in apply_signature cipher = Cipher(js=js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 43, in init self.throttling_plan = get_throttling_plan(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 387, in get_throttling_plan raw_code = get_throttling_function_code(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 301, in get_throttling_function_code code_lines_list = find_object_from_startpoint(js, match.span()[1]).split('\n') AttributeError: 'NoneType' object has no attribute 'span' Exception in thread d2: Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 910, in run self._target(*self._args, **self._kwargs) File "/home/sad/Downloads/Smart-Youtube-Playlist-Downloader/yt_playlist_downloader.py", line 45, in downloader2 ys = yt.streams.get_highest_resolution() File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 292, in streams return StreamQuery(self.fmt_streams) File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 177, in fmt_streams extract.apply_signature(stream_manifest, self.vid_info, self.js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/extract.py", line 409, in apply_signature cipher = Cipher(js=js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 43, in init self.throttling_plan = get_throttling_plan(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 387, in get_throttling_plan raw_code = get_throttling_function_code(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 301, in get_throttling_function_code code_lines_list = find_object_from_startpoint(js, match.span()[1]).split('\n') AttributeError: 'NoneType' object has no attribute 'span'

┌──(sad㉿Demon)-[~/Downloads/Smart-Youtube-Playlist-Downloader] └─$

amandalal007 commented 2 years ago

see and with updated version also ....

┌──(sad㉿Demon)-[~/Downloads/Smart-Youtube-Playlist-Downloader] └─$ python3 yt_playlist_downloader.py "https://youtube.com/playlist?list=PLHmLKajfpwUigLES7uvNHRUS_Z_NWMy3S" Choose resolution to download.

  1. 480p
  2. 720p
  3. 1080p
  4. 4k Select resolution: 3

Playlist Name : sad songs mix Channel Name : by Chilled Sad Total Videos : 36 Total Views : 37978 Downloading Started...

Exception in thread d3: Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 910, in run self._target(*self._args, self._kwargs) File "/home/sad/Downloads/Smart-Youtube-Playlist-Downloader/yt_playlist_downloader.py", line 78, in downloader3 for j in yt.streams: File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 292, in streams return StreamQuery(self.fmt_streams) File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 177, in fmt_streams extract.apply_signature(stream_manifest, self.vid_info, self.js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/extract.py", line 409, in apply_signature cipher = Cipher(js=js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 43, in init self.throttling_plan = get_throttling_plan(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 387, in get_throttling_plan raw_code = get_throttling_function_code(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 301, in get_throttling_function_code code_lines_list = find_object_from_startpoint(js, match.span()[1]).split('\n') AttributeError: 'NoneType' object has no attribute 'span' Exception in thread d1: Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 910, in run self._target(*self._args, *self._kwargs) File "/home/sad/Downloads/Smart-Youtube-Playlist-Downloader/yt_playlist_downloader.py", line 52, in downloader1 for j in yt.streams: File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 292, in streams return StreamQuery(self.fmt_streams) File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 177, in fmt_streams extract.apply_signature(stream_manifest, self.vid_info, self.js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/extract.py", line 409, in apply_signature cipher = Cipher(js=js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 43, in init self.throttling_plan = get_throttling_plan(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 387, in get_throttling_plan raw_code = get_throttling_function_code(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 301, in get_throttling_function_code code_lines_list = find_object_from_startpoint(js, match.span()[1]).split('\n') AttributeError: 'NoneType' object has no attribute 'span' Exception in thread d4: Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 910, in run self._target(self._args, self._kwargs) File "/home/sad/Downloads/Smart-Youtube-Playlist-Downloader/yt_playlist_downloader.py", line 91, in downloader4 for j in yt.streams: File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 292, in streams return StreamQuery(self.fmt_streams) File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 177, in fmt_streams extract.apply_signature(stream_manifest, self.vid_info, self.js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/extract.py", line 409, in apply_signature cipher = Cipher(js=js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 43, in init self.throttling_plan = get_throttling_plan(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 387, in get_throttling_plan raw_code = get_throttling_function_code(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 301, in get_throttling_function_code code_lines_list = find_object_from_startpoint(js, match.span()[1]).split('\n') AttributeError: 'NoneType' object has no attribute 'span' Exception in thread d2: Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 910, in run self._target(*self._args, **self._kwargs) File "/home/sad/Downloads/Smart-Youtube-Playlist-Downloader/yt_playlist_downloader.py", line 65, in downloader2 for j in yt.streams: File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 292, in streams return StreamQuery(self.fmt_streams) File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 177, in fmt_streams extract.apply_signature(stream_manifest, self.vid_info, self.js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/extract.py", line 409, in apply_signature cipher = Cipher(js=js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 43, in init self.throttling_plan = get_throttling_plan(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 387, in get_throttling_plan raw_code = get_throttling_function_code(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 301, in get_throttling_function_code code_lines_list = find_object_from_startpoint(js, match.span()[1]).split('\n') AttributeError: 'NoneType' object has no attribute 'span'

┌──(sad㉿Demon)-[~/Downloads/Smart-Youtube-Playlist-Downloader] └─$

amandalal007 commented 2 years ago

i even tried many differnt playlist links not even one of them worked

amandalal007 commented 2 years ago

hey brother at least tell me u are working on it or not for fixing it

prokunal commented 2 years ago

script is working fine from side.. I am using the same script.

here is the result:

┌──(kali㉿kali)-[~/Desktop/script_test] └─$ python3 new.py "https://www.youtube.com/watch?v=z9bZufPHFLU&list=PLfqMhTWNBTe0b2nM6JHVCnAkhQRGiZMSJ" Choose resolution to download.

  1. 480p
  2. 720p
  3. 1080p
  4. 4k Select resolution: 3

Playlist Name : C++ Full Course | C++ Tutorial | Data Structures & Algorithms Channel Name : Apna College Total Videos : 226 Total Views : 16894398 Downloading Started...

threading 4 --> Graphs - Surrounded Region C++ Placement Course Lecture 3419.mp4 -> Downloaded threading 2 --> Deletion in Linked List C++ Placement Course Lecture 222.mp4 -> Downloaded threading 3 --> Zig Zag Traversal Binary Search Tree C++ Placement Course Lecture 287.mp4 -> Downloaded threading 2 --> Reverse a Linked List C++ Placement Course Lecture 223.mp4 -> Downloaded threading 1 --> 1 Introduction to C++ Data Structures and Algorithms College Placement Course Lecture 1.mp4 -> Downloaded threading 4 --> Fibonacci Sequence - Dynamic Programming C++ Placement Course Lecture 352.mp4 -> Downloaded threading 3 --> Identical Binary Search Tree C++ Placement Course Lecture 288.mp4 -> Downloaded threading 2 --> Reverse K Nodes in a Linked List C++ Placement Course Lecture 224.mp4 -> Downloaded

i even tried many differnt playlist links not even one of them worked

prokunal commented 2 years ago

see and with updated version also ....

┌──(sad㉿Demon)-[~/Downloads/Smart-Youtube-Playlist-Downloader] └─$ python3 yt_playlist_downloader.py "https://youtube.com/playlist?list=PLHmLKajfpwUigLES7uvNHRUS_Z_NWMy3S" Choose resolution to download.

  1. 480p
  2. 720p
  3. 1080p
  4. 4k Select resolution: 3

Playlist Name : sad songs mix Channel Name : by Chilled Sad Total Videos : 36 Total Views : 37978 Downloading Started...

Exception in thread d3: Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 910, in run self._target(*self._args, self._kwargs) File "/home/sad/Downloads/Smart-Youtube-Playlist-Downloader/yt_playlist_downloader.py", line 78, in downloader3 for j in yt.streams: File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 292, in streams return StreamQuery(self.fmt_streams) File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 177, in fmt_streams extract.apply_signature(stream_manifest, self.vid_info, self.js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/extract.py", line 409, in apply_signature cipher = Cipher(js=js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 43, in init self.throttling_plan = get_throttling_plan(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 387, in get_throttling_plan raw_code = get_throttling_function_code(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 301, in get_throttling_function_code code_lines_list = find_object_from_startpoint(js, match.span()[1]).split('\n') AttributeError: 'NoneType' object has no attribute 'span' Exception in thread d1: Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 910, in run self._target(*self._args, self._kwargs) File "/home/sad/Downloads/Smart-Youtube-Playlist-Downloader/yt_playlist_downloader.py", line 52, in downloader1 for j in yt.streams: File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 292, in streams return StreamQuery(self.fmt_streams) File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 177, in fmt_streams extract.apply_signature(stream_manifest, self.vid_info, self.js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/extract.py", line 409, in apply_signature cipher = Cipher(js=js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 43, in init* self.throttling_plan = get_throttling_plan(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 387, in get_throttling_plan raw_code = get_throttling_function_code(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 301, in get_throttling_function_code code_lines_list = find_object_from_startpoint(js, match.span()[1]).split('\n') AttributeError: 'NoneType' object has no attribute 'span' Exception in thread d4: Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 910, in run self._target(self._args, self._kwargs) File "/home/sad/Downloads/Smart-Youtube-Playlist-Downloader/yt_playlist_downloader.py", line 91, in downloader4 for j in yt.streams: File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 292, in streams return StreamQuery(self.fmt_streams) File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 177, in fmt_streams extract.apply_signature(stream_manifest, self.vid_info, self.js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/extract.py", line 409, in apply_signature cipher = Cipher(js=js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 43, in init self.throttling_plan = get_throttling_plan(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 387, in get_throttling_plan raw_code = get_throttling_function_code(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 301, in get_throttling_function_code code_lines_list = find_object_from_startpoint(js, match.span()[1]).split('\n') AttributeError: 'NoneType' object has no attribute 'span' Exception in thread d2: Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 910, in run self._target(*self._args, self._kwargs) File "/home/sad/Downloads/Smart-Youtube-Playlist-Downloader/yt_playlist_downloader.py", line 65, in downloader2 for j in yt.streams: File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 292, in streams return StreamQuery(self.fmt_streams) File "/home/sad/.local/lib/python3.9/site-packages/pytube/main.py", line 177, in fmt_streams extract.apply_signature(stream_manifest, self.vid_info, self.js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/extract.py", line 409, in apply_signature cipher = Cipher(js=js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 43, in init** self.throttling_plan = get_throttling_plan(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 387, in get_throttling_plan raw_code = get_throttling_function_code(js) File "/home/sad/.local/lib/python3.9/site-packages/pytube/cipher.py", line 301, in get_throttling_function_code code_lines_list = find_object_from_startpoint(js, match.span()[1]).split('\n') AttributeError: 'NoneType' object has no attribute 'span'

┌──(sad㉿Demon)-[~/Downloads/Smart-Youtube-Playlist-Downloader] └─$

this problem is from your side, your pytube module is not working properly, try to run this script with root or other user, if still not works, then uninstall the pytube module and install it again, then run again.

to uninstall pytube $ pip uninstall pytube and install it again $ pip install pytube

try this, tell me if this works or not.

amandalal007 commented 2 years ago

thanks brother it started after updating pytube by the can u tell me where to learn coding and what to learn first