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 645 forks source link

Mpsyt crashes when I try to search playlists #1090

Closed octoturt closed 1 year ago

octoturt commented 4 years ago

Seems to be a bug involving time? I had to feed it my own YouTube v3 API Key so I don't know if that has anything to do with it. No problems when I search for individual videos, though.

I'm running OSX 10.15.4 and using MPV as the player. I installed everything via Brew.

Searching playlists for joco                                                                                                
Traceback (most recent call last):
  File "/usr/local/Cellar/mps-youtube/0.2.8_10/libexec/lib/python3.8/site-packages/mps_youtube/main.py", line 65, in matchfunction
    func(*matches)
  File "/usr/local/Cellar/mps-youtube/0.2.8_10/libexec/lib/python3.8/site-packages/mps_youtube/commands/search.py", line 386, in pl_search
    g.content = content.generate_playlist_display()
  File "/usr/local/Cellar/mps-youtube/0.2.8_10/libexec/lib/python3.8/site-packages/mps_youtube/content.py", line 155, in generate_playlist_display
    updated = yt_datetime(x.get('updated'))[1]
  File "/usr/local/Cellar/mps-youtube/0.2.8_10/libexec/lib/python3.8/site-packages/mps_youtube/util.py", line 315, in yt_datetime
    time_obj = time.strptime(yt_date_time, "%Y-%m-%dT%H:%M:%S.%fZ")
  File "/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/_strptime.py", line 562, in _strptime_time
    tt = _strptime(data_string, format)[0]
  File "/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '2012-02-23T02:14:42Z' does not match format '%Y-%m-%dT%H:%M:%S.%fZ'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/mpsyt", line 11, in <module>
    load_entry_point('mps-youtube==0.2.8', 'console_scripts', 'mpsyt')()
  File "/usr/local/Cellar/mps-youtube/0.2.8_10/libexec/lib/python3.8/site-packages/mps_youtube/main.py", line 148, in main
    if matchfunction(i.function, i.regex, userinput):
  File "/usr/local/Cellar/mps-youtube/0.2.8_10/libexec/lib/python3.8/site-packages/mps_youtube/main.py", line 80, in matchfunction
    content.generate_songlist_display(zeromsg=g.message)
  File "/usr/local/Cellar/mps-youtube/0.2.8_10/libexec/lib/python3.8/site-packages/mps_youtube/content.py", line 74, in generate_songlist_display
    return generate_playlist_display()
  File "/usr/local/Cellar/mps-youtube/0.2.8_10/libexec/lib/python3.8/site-packages/mps_youtube/content.py", line 155, in generate_playlist_display
    updated = yt_datetime(x.get('updated'))[1]
  File "/usr/local/Cellar/mps-youtube/0.2.8_10/libexec/lib/python3.8/site-packages/mps_youtube/util.py", line 315, in yt_datetime
    time_obj = time.strptime(yt_date_time, "%Y-%m-%dT%H:%M:%S.%fZ")
  File "/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/_strptime.py", line 562, in _strptime_time
    tt = _strptime(data_string, format)[0]
  File "/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '2012-02-23T02:14:42Z' does not match format '%Y-%m-%dT%H:%M:%S.%fZ'
marcomeyerVFX commented 4 years ago

I am getting the same behaviour on linux

frojnd commented 4 years ago

I get the same behaviour:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/mps_youtube/main.py", line 70, in matchfunction
    func(*matches)
  File "/usr/lib/python3.8/site-packages/mps_youtube/commands/search.py", line 390, in pl_search
    g.content = content.generate_playlist_display()
  File "/usr/lib/python3.8/site-packages/mps_youtube/content.py", line 162, in generate_playlist_display
    updated = yt_datetime(x.get('updated'))[1]
  File "/usr/lib/python3.8/site-packages/mps_youtube/util.py", line 332, in yt_datetime
    time_obj = time.strptime(yt_date_time, "%Y-%m-%dT%H:%M:%S.%fZ")
  File "/usr/lib/python3.8/_strptime.py", line 562, in _strptime_time
    tt = _strptime(data_string, format)[0]
  File "/usr/lib/python3.8/_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '2014-04-10T02:03:58Z' does not match format '%Y-%m-%dT%H:%M:%S.%fZ'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/mpsyt", line 11, in <module>
    load_entry_point('mps-youtube==0.2.8', 'console_scripts', 'mpsyt')()
  File "/usr/lib/python3.8/site-packages/mps_youtube/main.py", line 153, in main
    if matchfunction(i.function, i.regex, userinput):
  File "/usr/lib/python3.8/site-packages/mps_youtube/main.py", line 85, in matchfunction
    content.generate_songlist_display(zeromsg=g.message)
  File "/usr/lib/python3.8/site-packages/mps_youtube/content.py", line 82, in generate_songlist_display
    return generate_playlist_display()
  File "/usr/lib/python3.8/site-packages/mps_youtube/content.py", line 162, in generate_playlist_display
    updated = yt_datetime(x.get('updated'))[1]
  File "/usr/lib/python3.8/site-packages/mps_youtube/util.py", line 332, in yt_datetime
    time_obj = time.strptime(yt_date_time, "%Y-%m-%dT%H:%M:%S.%fZ")
  File "/usr/lib/python3.8/_strptime.py", line 562, in _strptime_time
    tt = _strptime(data_string, format)[0]
  File "/usr/lib/python3.8/_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '2014-04-10T02:03:58Z' does not match format '%Y-%m-%dT%H:%M:%S.%fZ'

version: 0.2.8.r139.gb808697-1 OS: Linux I am using my generated keys because with default key it won't even start mpsyt

justahuman1 commented 4 years ago

As stated by muzicstation,

If you know the playlist URL or id. With the pl command, it worked fine. It's not a solution to the problem, but I'm getting by with this for the time being.

It does indeed work, and a solution has been proposed by h-wata (yet to be pulled).

iamtalhaasghar commented 1 year ago

was fixed https://github.com/mps-youtube/yewtube/pull/1088