iamtalhaasghar / yewtube

Terminal based YouTube player and downloader. No Youtube API key required. Moved to https://github.com/mps-youtube/yewtube
GNU General Public License v3.0
246 stars 20 forks source link

Some urls play in video mode even when -a option is added #68

Open AndreiBiziuk opened 2 years ago

AndreiBiziuk commented 2 years ago

Issue / Suggestion

There is -a option to play playlist item in audio mode. On some urls it is working but on others not.

Not working:

yt url MFiqhfQBIJQ, '1 -a'

Status text says mp4 audio only but mpv window opens with image.

yt-dlp sees formats with audio only

-> % yt-dlp MFiqhfQBIJQ -f -                            
[youtube] MFiqhfQBIJQ: Downloading webpage
[youtube] MFiqhfQBIJQ: Downloading android player API JSON
[youtube] MFiqhfQBIJQ: Downloading MPD manifest
[youtube] MFiqhfQBIJQ: Downloading MPD manifest
[info] Available formats for MFiqhfQBIJQ:
ID       EXT   RESOLUTION FPS │   FILESIZE   TBR PROTO │ VCODEC        VBR ACODEC      ABR     ASR MORE INFO
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
sb2      mhtml 48x27          │                  mhtml │ images                                    storyboard
sb1      mhtml 80x45          │                  mhtml │ images                                    storyboard
sb0      mhtml 160x90         │                  mhtml │ images                                    storyboard
139-dash m4a   audio only     │    2.01MiB   50k dash  │ audio only        mp4a.40.5   50k 22050Hz DASH audio, m4a_dash
139      m4a   audio only     │    2.01MiB   47k https │ audio only        mp4a.40.5   47k 22050Hz low, m4a_dash
140-dash m4a   audio only     │    5.35MiB  129k dash  │ audio only        mp4a.40.2  129k 44100Hz DASH audio, m4a_dash
140      m4a   audio only     │    5.35MiB  127k https │ audio only        mp4a.40.2  127k 44100Hz medium, m4a_dash
251-dash webm  audio only     │    5.69MiB  159k dash  │ audio only        opus       159k 48000Hz DASH audio, webm_dash
251      webm  audio only     │    5.69MiB  135k https │ audio only        opus       135k 48000Hz medium, webm_dash
17       3gp   176x144     10 │    1.44MiB   34k https │ mp4v.20.3     34k mp4a.40.2    0k 22050Hz 144p
160      mp4   256x144     30 │ ~  4.65MiB  108k dash  │ avc1.4d400b  108k video only              DASH video, mp4_dash
278      webm  256x144     30 │ ~  4.09MiB   95k dash  │ vp9           95k video only              DASH video, webm_dash
133      mp4   426x240     30 │ ~ 10.43MiB  242k dash  │ avc1.4d400c  242k video only              DASH video, mp4_dash
242      webm  426x240     30 │ ~  9.50MiB  220k dash  │ vp9          220k video only              DASH video, webm_dash
134-dash mp4   640x360     30 │    2.03MiB  219k dash  │ avc1.4d401e  219k video only              DASH video, mp4_dash
134      mp4   640x360     30 │    2.03MiB   48k https │ avc1.4d401e   48k video only              360p, mp4_dash
18       mp4   640x360     30 │ ~  7.52MiB  174k https │ avc1.42001E  174k mp4a.40.2    0k 44100Hz 360p
243      webm  640x360     30 │ ~ 17.48MiB  405k dash  │ vp9          405k video only              DASH video, webm_dash
135      mp4   854x480     30 │ ~ 49.77MiB 1155k dash  │ avc1.4d4014 1155k video only              DASH video, mp4_dash
244      webm  854x480     30 │ ~ 32.43MiB  752k dash  │ vp9          752k video only              DASH video, webm_dash
136      mp4   1280x720    30 │ ~ 99.54MiB 2310k dash  │ avc1.4d4016 2310k video only              DASH video, mp4_dash
22       mp4   1280x720    30 │ ~ 25.63MiB  594k https │ avc1.64001F  594k mp4a.40.2    0k 44100Hz 720p
247      webm  1280x720    30 │ ~ 64.86MiB 1505k dash  │ vp9         1505k video only              DASH video, webm_dash
137      mp4   1920x1080   30 │ ~186.64MiB 4331k dash  │ avc1.64001e 4331k video only              DASH video, mp4_dash
248      webm  1920x1080   30 │ ~114.02MiB 2646k dash  │ vp9         2646k video only              DASH video, webm_dash

Working example:

yt url kR_WhDepN2w, '1 -a'

mpv window doesn't open

yt-dlp output:

-> % yt-dlp kR_WhDepN2w -f -        
[youtube] kR_WhDepN2w: Downloading webpage
[youtube] kR_WhDepN2w: Downloading android player API JSON
[info] Available formats for kR_WhDepN2w:
ID  EXT   RESOLUTION FPS │   FILESIZE  TBR PROTO │ VCODEC       VBR ACODEC      ABR     ASR MORE INFO
──────────────────────────────────────────────────────────────────────────────────────────────────────────────
sb2 mhtml 48x27          │                 mhtml │ images                                   storyboard
sb1 mhtml 80x45          │                 mhtml │ images                                   storyboard
sb0 mhtml 160x90         │                 mhtml │ images                                   storyboard
139 m4a   audio only     │    1.78MiB  47k https │ audio only       mp4a.40.5   47k 22050Hz low, m4a_dash
249 webm  audio only     │    1.85MiB  49k https │ audio only       opus        49k 48000Hz low, webm_dash
250 webm  audio only     │    2.44MiB  65k https │ audio only       opus        65k 48000Hz low, webm_dash
140 m4a   audio only     │    4.75MiB 127k https │ audio only       mp4a.40.2  127k 44100Hz medium, m4a_dash
251 webm  audio only     │    4.76MiB 127k https │ audio only       opus       127k 48000Hz medium, webm_dash
17  3gp   176x144      8 │    1.26MiB  33k https │ mp4v.20.3    33k mp4a.40.2    0k 22050Hz 144p
160 mp4   256x144     25 │  342.23KiB   8k https │ avc1.4d400c   8k video only              144p, mp4_dash
278 webm  256x144     25 │  751.29KiB  19k https │ vp9          19k video only              144p, webm_dash
133 mp4   426x240     25 │  685.33KiB  17k https │ avc1.4d4015  17k video only              240p, mp4_dash
242 webm  426x240     25 │    1.22MiB  32k https │ vp9          32k video only              240p, webm_dash
134 mp4   640x360     25 │  794.83KiB  20k https │ avc1.4d401e  20k video only              360p, mp4_dash
18  mp4   640x360     25 │    7.42MiB 198k https │ avc1.42001E 198k mp4a.40.2    0k 44100Hz 360p
243 webm  640x360     25 │    2.23MiB  59k https │ vp9          59k video only              360p, webm_dash
135 mp4   854x480     25 │    1.21MiB  32k https │ avc1.4d401e  32k video only              480p, mp4_dash
244 webm  854x480     25 │    2.16MiB  57k https │ vp9          57k video only              480p, webm_dash
136 mp4   1280x720    25 │    1.97MiB  52k https │ avc1.4d401f  52k video only              720p, mp4_dash
22  mp4   1280x720    25 │ ~  6.88MiB 179k https │ avc1.64001F 179k mp4a.40.2    0k 44100Hz 720p
247 webm  1280x720    25 │    5.98MiB 159k https │ vp9         159k video only              720p, webm_dash
137 mp4   1920x1080   25 │    3.16MiB  84k https │ avc1.640028  84k video only              1080p, mp4_dash
248 webm  1920x1080   25 │   10.34MiB 276k https │ vp9         276k video only              1080p, webm_dash

Your Environment

-> % yt --version
yewtube version : 2.8.2 yt_dlp version : 2022.02.04 Python version : 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0] Processor : Machine type : x86_64 Architecture : 64bit, ELF Platform : Linux-5.16.15-arch1-1-x86_64-with-glibc2.35 sys.stdout.enc : utf-8 default enc : utf-8 Config dir : /home/andrei/.config/mps-youtube dbus : None glib : False env:TERM : xterm-256color env:SHELL : /bin/bash env:LANG : ru_RU.UTF-8 env:LANGUAGE : ru:en_US

rachmadaniHaryono commented 2 years ago

related #66