mps-youtube / yewtube

yewtube, forked from mps-youtube , is a Terminal based YouTube player and downloader. No Youtube API key required.
GNU General Public License v3.0
8.07k stars 648 forks source link

AttributeError: 'nonetype' object has no attribute 'group' #1056

Closed Rolandocmr closed 4 years ago

Rolandocmr commented 4 years ago

Hey so im a total noob and would like to know how to get this to work. below is the error it sends when i select a number(song) to play.

Issue / Suggestion

                                                                                       [1/20>

Traceback (most recent call last): File "/usr/bin/mpsyt", line 11, in load_entry_point('mps-youtube==0.2.8', 'console_scripts', 'mpsyt')() File "/usr/lib/python3/dist-packages/mps_youtube/main.py", line 153, in main if matchfunction(i.function, i.regex, userinput): File "/usr/lib/python3/dist-packages/mps_youtube/main.py", line 70, in matchfunction func(matches) File "/usr/lib/python3/dist-packages/mps_youtube/commands/play.py", line 102, in play g.PLAYER_OBJ.play(songlist, shuffle, repeat, override) File "/usr/lib/python3/dist-packages/mps_youtube/player.py", line 77, in play softrepeat=self.softrepeat) File "/usr/lib/python3/dist-packages/mps_youtube/player.py", line 319, in stream_details streams.get(song, force=failcount, callback=screen.writestatus) File "/usr/lib/python3/dist-packages/mps_youtube/streams.py", line 51, in get p = util.get_pafy(vid, force=force, callback=callback) File "/usr/lib/python3/dist-packages/mps_youtube/util.py", line 207, in get_pafy p = pafy.new(ytid, callback=callback_fn) File "/usr/lib/python3/dist-packages/pafy/pafy.py", line 122, in new return Pafy(url, basic, gdata, size, callback, ydl_opts) File "/usr/lib/python3/dist-packages/pafy/backend_internal.py", line 42, in init super(InternPafy, self).init(args, *kwargs) File "/usr/lib/python3/dist-packages/pafy/backend_shared.py", line 95, in init self._fetch_basic() File "/usr/lib/python3/dist-packages/pafy/backend_internal.py", line 50, in _fetch_basic allinfo = get_video_info(self.videoid, self.callback) File "/usr/lib/python3/dist-packages/pafy/backend_internal.py", line 268, in get_video_info sts = re.search(r'sts"\s:\s*(\d+)', embed_webpage).group(1) AttributeError: 'NoneType' object has no attribute 'group'

Your Environment

im in a persistent MXlinux usb drive. mp $ mpsyt --version WARNING:root:pafy: youtube-dl not found; falling back to internal backend. This is not as well maintained as the youtube-dl backend. To hide this message, set the environmental variable PAFY_BACKEND to "internal". mpsyt version : 0.2.8 notes : released 17 February 2018 pafy version : 0.5.2 (internal backend) Python version : 3.7.3 (default, Apr 3 2019, 05:39:12) [GCC 8.3.0] Processor : Machine type : x86_64 Architecture : 64bit, ELF Platform : Linux-4.19.0-6-amd64-x86_64-with-MX-19-patito_feo sys.stdout.enc : UTF-8 default enc : utf-8 Config dir : /home/demo/.config/mps-youtube env:TERM : xterm-256color env:SHELL : /bin/bash env:LANG : en_US.UTF-8

Already tried to install/update phyton-pip and phyton3-pip but im not sure whats going wrong.

kz6wk9 commented 4 years ago

what happens when you try with youtube-dl backend ?

Rolandocmr commented 4 years ago

yeah so i didnt installed phyton correctly it seems pip wasn't working properly. followed instructions from scratch and worked.

Rolandocmr commented 4 years ago

what happens when you try with youtube-dl backend ?

thank you!

FedericoCeratto commented 3 years ago

@kz6wk9 I get the same error with mpsyt version 0.2.8 installed from Debian and without youtube-dl. mps-youtube should catch the exception and suggest installing youtube-dl