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

Some videos do not play -- wrong content-lenght returned? #1108

Open diefrosch opened 4 years ago

diefrosch commented 4 years ago

Issue / Suggestion

Some YT videos won't play. mpsyt playback aborts and jumps right back to search results. Directly calling a URL on the mpsyt command line doesn't work either. Symptoms are identical to issue #826 but the cause seems different (I think #826 has been fixed in the meantime).

One possible clue: all videos that don't work show a stream size of zero Mb in the mpsyt player status line. Videos that work show a plausible size.

Example links ( these are 1st and 2nd part of the same piece):

By inserting print() statements here and there I think I ascertained that the _get_content_length function in streams.py

Disclaimer: I'm not a developer and I had never seen Python code before, so please take the above for what it is worth.

Thanks everybody for the great work. mps-youtube is insanely cool software!

Your Environment

I am using mps-youtube version 0.2.8 development (installed with pip) -- I'm controlling it remotely via ssh.

mpsyt --version mpsyt version : 0.2.8 notes : released 17 February 2018 pafy version : 0.5.5 (youtube-dl backend) youtube-dl version : 2020.07.28 Python version : 3.5.2 (default, Jul 17 2020, 14:04:10) [GCC 5.4.0 20160609] Processor : x86_64 Machine type : x86_64 Architecture : 64bit, ELF Platform : Linux-4.4.0-186-generic-x86_64-with-Ubuntu-16.04-xenial sys.stdout.enc : UTF-8 default enc : utf-8 Config dir : /home/diefrosch/.config/mps-youtube env:TERM : screen env:SHELL : /bin/bash env:LANG : en_US.UTF-8 env:LANGUAGE : en_US:en

Key Value
order : relevance
user_order :
max_res : 2160p
player : mpv
playerargs :
encoder : 0 [None]
notifier :
checkupdate : True
show_player_keys : True
fullscreen : False
show_status : True
always_repeat : False
columns :
ddir : /home/diefrosch/Downloads/mps
overwrite : True
show_video : False
search_music : False
window_pos :
window_size :
download_command :
lookup_metadata : True
lastfm_username :
lastfm_password :
lastfm_api_key :
lastfm_api_secret :
audio_format : auto
video_format : auto
api_key : autoplay : False
set_title : True
mpris : False
show_qrcode : False
history : True
input_history : True