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

ValueError: time data does not match format '%Y-%m-%dT%H:%M:%S.%fZ' #1086

Closed francutura closed 1 year ago

francutura commented 4 years ago

Issue / Suggestion

I have the following issue when trying to search for playlist by for example doing //test ValueError: time data '2015-10-23T19:17:36Z' does not match format '%Y-%m-%dT%H:%M:%S.%fZ'

Changing the way youtube date time is parsed fixed the problem for me. file util.py in function yt_datetime line 315: time_obj = time.strptime(yt_date_time, "%Y-%m-%dT%H:%M:%SZ") and line 325.

Can submit a PR with a fix?

Your Environment

mpsyt version : 0.2.8 notes : released 17 February 2018 pafy version : 0.5.5 (youtube-dl backend) youtube-dl version : 2020.05.08 Python version : 3.6.9 (default, Apr 18 2020, 01:56:04) [GCC 8.4.0] Processor : x86_64 Machine type : x86_64 Architecture : 64bit, ELF Platform : Linux-4.15.0-99-generic-x86_64-with-Ubuntu-18.04-bionic sys.stdout.enc : UTF-8 default enc : utf-8 Config dir : /home/fran/.config/mps-youtube env:TERM : xterm-256color env:SHELL : /bin/bash env:LANG : en_US.UTF-8

user0210 commented 4 years ago

thank you! ....I had the same problem and your solution fixed it for me

ximi75 commented 4 years ago

thank you your solution it works for me too

OS: Manjaro Linux x86_64 Kernel: 5.6.11-1-MANJARO

navya-xx commented 4 years ago

Same here.. OS: Ubuntu 18.04 Kernel: Linux 4.20.10-042010-generic

rochr4 commented 4 years ago

lol, every week something brakes, hilarious state this ap is now, what state it is now ?.. Thank You @francutura

qquq commented 4 years ago

Yep, the proposed fix worked for me too. Thx!

hypnull commented 4 years ago

We should add a condition to check for the "." included date format in case YouTube decides to rollback to that old format or it's used in any cached/older playlist data

philippkeller commented 4 years ago

Yay, the fix works for me too!

IMO the PR was not yet merged. To use it already:

git clone git@github.com:mps-youtube/mps-youtube.git
cd mps-youtube
git fetch origin pull/1088/head
git checkout -b pullrequest FETCH_HEAD
./mpsyt
trames57 commented 3 years ago

The "Date" field was also not showing from the set columns variable. This also fixed that issue. In arch linux, it is in /usr/lib/python3.8/site-packages/mps_youtube/util.py

antffs commented 3 years ago

Many thanks - works fine now with Pi Zero