Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[reddit] no subtitle tracks from video #7814

Closed
8 of 10 tasks
krichbanana opened this issue Aug 11, 2023 · 1 comment
Closed
8 of 10 tasks

[reddit] no subtitle tracks from video #7814

krichbanana opened this issue Aug 11, 2023 · 1 comment
Labels
patch-available There is patch available that should fix this issue. Someone needs to make a PR with it site-enhancement Feature request for some website

Comments

@krichbanana
Copy link
Contributor

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

Region

No response

Example URLs

https://old.reddit.com/r/MadeMeSmile/comments/15oihm8/just_a_little_off_the_top

Provide a description that is worded well enough to be understood

Reddit seems to have added automatic subtitle tracks to videos. Attempting to download the video with the subtitles does not yield any subs; I am greeted with a message to fill out an issue form, so that is what I'm doing.

Nevermind the accuracy of the subtitles in this case; it seems to be English only.

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

[debug] Command-line config: ['-Uv', '--write-description', '--write-info-json', '--write-subs', '--write-thumbnail', 'https://old.reddit.com/r/MadeMeSmile/comments/15oihm8/just_a_little_off_the_top/']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.07.06 [b532a3481] (pip)
[debug] Python 3.11.3 (CPython x86_64 64bit) - Linux-6.3.1-1-dirty-x86_64-with-glibc2.38 (OpenSSL 3.1.2 1 Aug 2023, glibc 2.38)
[debug] exe versions: ffmpeg 6.0 (setts), ffprobe 6.0, phantomjs broken, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.12.0, brotlicffi-1.0.9.2, certifi-2023.07.22, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1855 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.07.06, Current version: stable@2023.07.06
yt-dlp is up to date (stable@2023.07.06)
[Reddit] Extracting URL: https://old.reddit.com/r/MadeMeSmile/comments/15oihm8/just_a_little_off_the_top/
[Reddit] 15oihm8: Downloading JSON metadata
[Reddit] 15oihm8: Downloading m3u8 information
[Reddit] 15oihm8: Downloading MPD manifest
WARNING: [Reddit] Ignoring subtitle tracks found in the DASH manifest; if any subtitle tracks are missing, please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] rbf71u7tajhb1: Downloading 1 format(s): hls-1586+dash-7
[info] There's no video description to write
[info] There are no subtitles for the requested languages
[info] Downloading video thumbnail 4 ...
[info] Writing video thumbnail 4 to: Just a little off the top [rbf71u7tajhb1].png
[info] Writing video metadata as JSON to: Just a little off the top [rbf71u7tajhb1].info.json
[debug] Invoking hlsnative downloader on "https://v.redd.it/rbf71u7tajhb1/HLS_720.m3u8"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 3
[download] Destination: Just a little off the top [rbf71u7tajhb1].fhls-1586.mp4
[download] 100% of    1.65MiB in 00:00:00 at 3.02MiB/s
[debug] Invoking http downloader on "https://v.redd.it/rbf71u7tajhb1/DASH_AUDIO_128.mp4"
[download] Destination: Just a little off the top [rbf71u7tajhb1].fdash-7.m4a
[download] 100% of  151.18KiB in 00:00:00 at 1.03MiB/s
[Merger] Merging formats into "Just a little off the top [rbf71u7tajhb1].mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Just a little off the top [rbf71u7tajhb1].fhls-1586.mp4' -i 'file:Just a little off the top [rbf71u7tajhb1].fdash-7.m4a' -c copy -map 0:v:0 -map 1:a:0 -movflags +faststart 'file:Just a little off the top [rbf71u7tajhb1].temp.mp4'
Deleting original file Just a little off the top [rbf71u7tajhb1].fdash-7.m4a (pass -k to keep)
Deleting original file Just a little off the top [rbf71u7tajhb1].fhls-1586.mp4 (pass -k to keep)
@krichbanana krichbanana added site-enhancement Feature request for some website triage Untriaged issue labels Aug 11, 2023
@bashonly
Copy link
Member

diff --git a/yt_dlp/extractor/reddit.py b/yt_dlp/extractor/reddit.py
index 813e62874..62f669f35 100644
--- a/yt_dlp/extractor/reddit.py
+++ b/yt_dlp/extractor/reddit.py
@@ -319,16 +319,20 @@ def add_thumbnail(src):
                 'format_id': 'fallback',
                 'format_note': 'DASH video, mp4_dash',
             }]
-            formats.extend(self._extract_m3u8_formats(
-                hls_playlist_url, display_id, 'mp4', m3u8_id='hls', fatal=False))
-            formats.extend(self._extract_mpd_formats(
-                dash_playlist_url, display_id, mpd_id='dash', fatal=False))
+            hls_fmts, subtitles = self._extract_m3u8_formats_and_subtitles(
+                hls_playlist_url, display_id, 'mp4', m3u8_id='hls', fatal=False)
+            formats.extend(hls_fmts)
+            dash_fmts, dash_subs = self._extract_mpd_formats_and_subtitles(
+                dash_playlist_url, display_id, mpd_id='dash', fatal=False)
+            formats.extend(dash_fmts)
+            self._merge_subtitles(dash_subs, target=subtitles)
 
             return {
                 **info,
                 'id': video_id,
                 'display_id': display_id,
                 'formats': formats,
+                'subtitles': subtitles,
                 'duration': int_or_none(reddit_video.get('duration')),
             }
 

@bashonly bashonly added patch-available There is patch available that should fix this issue. Someone needs to make a PR with it and removed triage Untriaged issue labels Aug 12, 2023
aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this issue Apr 21, 2024
Closes yt-dlp#7814
Authored by: bashonly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch-available There is patch available that should fix this issue. Someone needs to make a PR with it site-enhancement Feature request for some website
Projects
None yet
Development

No branches or pull requests

2 participants