Skip to content

Conversation

@elelay
Copy link
Member

@elelay elelay commented Jul 27, 2021

See https://www.youtube.com/channel/UCPiFOcskeiOj0jHz3YCWDBQ with settings:

 "youtube": {
    "preferred_fmt_id": 0,
    "preferred_fmt_ids": [
      "worstaudio"
    ]
  }

The mime type reported by youtube-dl is 'audio/webm', then the end filename doesn't have an extension.

@elelay elelay requested a review from auouymous July 27, 2021 17:11
@auouymous
Copy link
Member

What exactly is the issue?

Without patch, downloading with gpodder(249) or ytdl(249 or worstaudio) produces a weba file. The filename in gpodder's database and on disk both match and look like CC2tv #123 abc.weba

With the patch, the file has the same filename on disk and in database but now has a webm extension.

@elelay
Copy link
Member Author

elelay commented Aug 1, 2021

On my machine (gPodder master@016cde21, youtube-dl 21.06.06), it doesn't get a .weba extension.
Regarding the fix, .weba not .webm should be associated with audio/webm.

1627808264.388113 [gpodder.gtkui.main] DEBUG: Downloading episode: CC2tv #294 Die DJI Pocket 2 Kamera
1627808264.389442 [gpodder.model] INFO: Setting download filename: CC2tv #294 Die DJI Pocket 2 Kamera.bin
1627808264.414928 [gpodder.my] DEBUG: Storing 1 episode download actions
1627808264.415369 [gpodder.download] INFO: 1 tasks to do, can start at most 16 threads, 0 threads currently running
1627808264.415458 [gpodder.download] INFO: Starting new worker thread.
1627808264.415551 [gpodder.util] DEBUG: run_in_background: <bound method DownloadQueueWorker.run of MainThread> (False)
1627808264.415709 [gpodder.download] INFO: Starting new thread: Thread-4
1627808264.415979 [gpodder.gtkui.main] INFO: CC2tv #294 Die DJI Pocket 2 Kamera: 0.000000
1627808264.416107 [gpodder.download] INFO: Thread-4 is processing: CC2tv #294 Die DJI Pocket 2 Kamera
1627808264.416452 [gpodder.registry] INFO: custom_downloader resolved by custom_downloader from youtube-dl: None -> <youtube-dl.YoutubeCustomDownload object at 0x7f119c76e7f0>
1627808264.416539 [gpodder.download] INFO: Downloading https://www.youtube.com/watch?v=up7n054WTTM with <youtube-dl.YoutubeCustomDownload object at 0x7f119c76e7f0>
1627808264.416710 [youtube-dl] DEBUG: format=worstaudio
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.06.06
[debug] Python version 3.9.6 (CPython) - Linux-5.13.5-arch1-1-x86_64-with-glibc2.33
[debug] exe versions: ffmpeg 4.4, ffprobe 4.4, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] up7n054WTTM: Downloading webpage
[debug] Invoking downloader on 'https://r13---sn-4gxx-25ge7.googlevideo.com/videoplayback?expire=1627829864&ei=CGIGYZqkNLH_sALx2rnoBg&ip=82.65.127.201&id=o-ABBCu1p89KNsgcUI8NJZDJ9MHmva3chKhiiBjZUe9R7C&itag=249&source=youtube&requiressl=yes&mh=q3&mm=31%2C29&mn=sn-4gxx-25ge7%2Csn-4gxx-25gel&ms=au%2Crdu&mv=m&mvi=13&nh=EAE%2CEAE&pl=19&initcwndbps=966250&vprv=1&mime=audio%2Fwebm&ns=mlTWCnAOeDvRW1dHXizvKQUG&gir=yes&clen=9332569&dur=1481.161&lmt=1620469751524619&mt=1627807967&fvip=13&keepalive=yes&fexp=24001373%2C24007246&c=WEB&txp=5432434&n=imsa5kg6NV_Ee8mSQ&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAPRoRfBfFxv3-iyDbKttrjRjuQS3kyPo3CLjznnkHpayAiAYgYiH1ZikEs8D4isl0ELKnske_tTofMcJuH30JeNcBw%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cnh%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRgIhAKFbDf-tDFdTkyx2HNPH6lA0gZvw_qZ52wDSp8zj_oPQAiEA82AHF_88vzZb7hq0fCQ05-RyuvjLoEmKQ8lXWywobxo%3D'
[download] Destination: /home/elelay/gPodder/Downloads/ComputerClub2/CC2tv #294 Die DJI Pocket 2 Kamera.bin.partial
[download]   0.0% of 8.90MiB at 261.98KiB/s ETA 00:351627808265.751447 [gpodder.download] DEBUG: Updating file size of /home/elelay/gPodder/Downloads/ComputerClub2/CC2tv #294 Die DJI Pocket 2 Kamera.bin to 9332569.0
[download]  11.2% of 8.90MiB at  6.30MiB/s ETA 00:011627808265.972179 [gpodder.gtkui.main] INFO: CC2tv #294 Die DJI Pocket 2 Kamera: 0.112247
[download] 100% of 8.90MiB in 00:01
1627808266.663161 [gpodder.download] INFO: Updating mime type: application/octet-stream => audio/webm
1627808266.664573 [gpodder.model] INFO: Choosing new filename: /home/elelay/gPodder/Downloads/ComputerClub2/CC2tv #294 Die DJI Pocket 2 Kamera.
1627808266.664766 [gpodder.model] INFO: Updating filename of https://www.youtube.com/watch?v=up7n054WTTM to "CC2tv #294 Die DJI Pocket 2 Kamera.".

@auouymous
Copy link
Member

My test client is running from git master with only the youtube-dl (2021.06.06) extension loaded.

https://github.com/gpodder/gpodder/blob/master/share/gpodder/extensions/youtube-dl.py#L120

That code changes the mimetype, and adding print(dot_ext) near it shows webm, so something after that point changes it to weba for me.

@auouymous
Copy link
Member

Gentoo has .weba for audio/webm in /etc/mime.types and mimetypes.guess_extension() is called which is why it works for me. Youtube-dl produces a .webm file and https://en.wikipedia.org/wiki/WebM doesn't mention anything about .weba. I'm not sure if we should use .weba or .webm, but it might be safer to stick with .webm.

@elelay
Copy link
Member Author

elelay commented Aug 11, 2021

That was it, then! Good to know: indeed archlinux doesn't have audio/webm in its /etc/mime.types.

@elelay
Copy link
Member Author

elelay commented Aug 11, 2021

Seems better to stick with .webm instead of .weba.
See https://groups.google.com/a/webmproject.org/g/webm-discuss/c/k9BXXVJupfw

@elelay elelay merged commit 71f8ee7 into master Aug 11, 2021
@elelay elelay deleted the fix-missing-audio_webm branch August 11, 2021 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants