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

Mentions in YouTube video title change when using flat-playlist + English extractor #6006

Closed
9 tasks done
megargayu opened this issue Jan 10, 2023 · 7 comments
Closed
9 tasks done
Labels
external issue Issue with an external tool site-bug Issue with a specific website

Comments

@megargayu
Copy link

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

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

Checklist

  • I'm reporting a bug unrelated to a specific site
  • I've verified that I'm running yt-dlp version 2023.01.06 (update instructions) or later (specify commit)
  • I've checked that all provided URLs are playable in a browser with the same IP and same login details
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar issues including closed ones. DO NOT post duplicates
  • I've read the guidelines for opening an issue

Provide a description that is worded well enough to be understood

YouTube has a feature called mentions, where a YouTube video's title can link to another channel. However, these can change the title based on if --flat-playlist is used vs if it isn't (with an English extractor).

Here is an example:

yt-dlp --simulate --flat-playlist --print filename --extractor-args "youtube:lang=en" https://www.youtube.com/playlist?list=PLsPsHE7buzKlu_x-7N4x7uPuidp3Kq2Y0

Prints out:

Ala Barfi! | Official Song | @MohitChauhanOfficial | @pritam7415 | Swanand Kirkire | Ranbir | Priyanka | Ileana [VBHjGRi4OqA].NA

While this:

yt-dlp --simulate --print filename --extractor-args "youtube:lang=en" https://www.youtube.com/watch?v=VBHjGRi4OqA

Prints out:

Ala Barfi! | Official Song | @Mohit Chauhan | @Pritam | Swanand Kirkire | Ranbir | Priyanka | Ileana [VBHjGRi4OqA].webm

(The first one is a dummy playlist I made with only the video in it).

Notice how @MohitChauhanOfficial | @pritam7415 changes to @Mohit Chauhan | @Pritam when --flat-playlist isn't used. If I remove the English extractor, both become the top one (@MohitChauhanOfficial | @pritam7415).

I don't really care which one stays the same between these, I just want consistency, so both have to be the same for my use case.

Thanks in advance!

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

yt-dlp --simulate --flat-playlist --print filename --extractor-args "youtube:lang=en" https://www.youtube.com/playlist?list=PLsPsHE7buzKlu_x-7N4x7uPuidp3Kq2Y0 -vU:

[debug] Command-line config: ['--simulate', '--flat-playlist', '--print', 'filename', '--extractor-args', 'youtube:lang=en', 'https://www.youtube.com/playlist?list=PLsPsHE7buzKlu_x-7N4x7uPuidp3Kq2Y0', '-vU']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2023.01.06 [6becd25] (pip)
[debug] Python 3.11.1 (CPython AMD64 64bit) - Windows-10-10.0.22621-SP0 (OpenSSL 1.1.1q  5 Jul 2022)
[debug] exe versions: ffmpeg 5.1.1-essentials_build-www.gyan.dev (setts), ffprobe 5.1.1-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.16.0, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1760 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2023.01.06, Current version: 2023.01.06
yt-dlp is up to date (2023.01.06)
[youtube:tab] Extracting URL: https://www.youtube.com/playlist?list=PLsPsHE7buzKlu_x-7N4x7uPuidp3Kq2Y0
[youtube:tab] PLsPsHE7buzKlu_x-7N4x7uPuidp3Kq2Y0: Downloading webpage
[youtube:tab] PLsPsHE7buzKlu_x-7N4x7uPuidp3Kq2Y0: Redownloading playlist API JSON with unavailable videos
[download] Downloading playlist: dummy playlist
[youtube:tab] Playlist dummy playlist: Downloading 1 items of 1
[debug] The information of all playlist entries will be held in memory
[download] Downloading item 1 of 1
Ala Barfi! | Official Song | @MohitChauhanOfficial | @pritam7415 | Swanand Kirkire | Ranbir | Priyanka | Ileana [VBHjGRi4OqA].NA
[download] Finished downloading playlist: dummy playlist

----------------------------------------------

yt-dlp --simulate --print filename --extractor-args "youtube:lang=en" https://www.youtube.com/watch?v=VBHjGRi4OqA -vU:

[debug] Command-line config: ['--simulate', '--print', 'filename', '--extractor-args', 'youtube:lang=en', 'https://www.youtube.com/watch?v=VBHjGRi4OqA', '-vU']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2023.01.06 [6becd25] (pip)
[debug] Python 3.11.1 (CPython AMD64 64bit) - Windows-10-10.0.22621-SP0 (OpenSSL 1.1.1q  5 Jul 2022)
[debug] exe versions: ffmpeg 5.1.1-essentials_build-www.gyan.dev (setts), ffprobe 5.1.1-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.16.0, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1760 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2023.01.06, Current version: 2023.01.06
yt-dlp is up to date (2023.01.06)
[youtube] Extracting URL: https://www.youtube.com/watch?v=VBHjGRi4OqA
[youtube] VBHjGRi4OqA: Downloading webpage
[youtube] VBHjGRi4OqA: Downloading android player API JSON
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec:vp9.2, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), channels, acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] VBHjGRi4OqA: Downloading 1 format(s): 244+251
Ala Barfi! | Official Song | @Mohit Chauhan | @Pritam | Swanand Kirkire | Ranbir | Priyanka | Ileana [VBHjGRi4OqA].webm
@megargayu megargayu added bug Bug that is not site-specific triage Untriaged issue labels Jan 10, 2023
@pukkandan
Copy link
Member

--extractor-args "youtube:lang=en" applies only to single videos, and therefore not to --flat-playlist. Remove it to get consistent result

@pukkandan pukkandan added question Question and removed bug Bug that is not site-specific triage Untriaged issue labels Jan 10, 2023
@megargayu
Copy link
Author

@pukkandan I can't remove it, because if I remove the --extractor-args "youtube:lang=en", then I get different outputs based on if I have --flat-playlist or not for certain videos with titles in a different language.

I added another video to the dummy playlist to showcase this:

yt-dlp --simulate --flat-playlist --print filename https://www.youtube.com/playlist?list=PLsPsHE7buzKlu_x-7N4x7uPuidp3Kq2Y0

Outputs:

Ala Barfi! | Official Song | @MohitChauhanOfficial | @pritam7415 | Swanand Kirkire | Ranbir | Priyanka | Ileana [VBHjGRi4OqA].NA
遊生夢死(Living idly and dying as if dreaming) - Eve MV [roh_p2l8DHo].NA

While this:

yt-dlp --simulate --print filename https://www.youtube.com/playlist?list=PLsPsHE7buzKlu_x-7N4x7uPuidp3Kq2Y0

Outputs:

Ala Barfi! | Official Song | @MohitChauhanOfficial | @pritam7415 | Swanand Kirkire | Ranbir | Priyanka | Ileana [VBHjGRi4OqA].webm
遊生夢死 - Eve MV [roh_p2l8DHo].webm

Notice that even though it fixes the problem for the first video, the second video has a completely different title.

I have asked about this previously in the discord server and got a reply saying that I just have to use the English extractor, which works perfectly and bypasses this issue (the second video always shows up as 遊生夢死(Living idly and dying as if dreaming) - Eve MV [roh_p2l8DHo] with the English extractor). I need the --flat-playlist as not adding it takes way too long with the amount of videos in my actual playlist.

@pukkandan
Copy link
Member

Perhaps what you want is --extractor-args youtube:lang=en-IN?

@coletdjnz
Copy link
Member

--extractor-args "youtube:lang=en" applies only to single videos, and therefore not to --flat-playlist. Remove it to get consistent result

I believe it's the opposite

@coletdjnz
Copy link
Member

coletdjnz commented Jan 10, 2023

What does the web browser show as the title in the playlist as well as the watch page with the youtube language set to English US?

There does seem to be some weird inconsistency here but I wonder if it's just to do with the different pages.

For me on mobile app it is inconsistent - as the watch page appears to hyperlink them and use the handle/username where playlist shows channel name. If this is the case then there is nothing we can do.

@coletdjnz coletdjnz added the external issue Issue with an external tool label Jan 10, 2023
@megargayu
Copy link
Author

What does the web browser show as the title in the playlist as well as the watch page with the youtube language set to English US?

@pukkandan On PC (website) it's consistently @MohitChauhanOfficial | @pritam7415 on both the video page and the playlist page.

Perhaps what you want is --extractor-args youtube:lang=en-IN?

This did somehow work (both gave @Mohit Chauhan | @Pritam), but this seems extremely janky and I don't trust it to work in the future with other videos with mentions in them, especially ones in other languages or even English.

--extractor-args "youtube:lang=en" applies only to single videos, and therefore not to --flat-playlist. Remove it to get consistent result

I believe it's the opposite

This did work for the second problem (the one I had solved before of a difference between --flat-playlist and not using it), but the this problem still occurs with the first video.

@coletdjnz
Copy link
Member

coletdjnz commented Jan 11, 2023

Yeah as far as I can tell this seems to be a bug/inconsistency on YouTube's end with how it handles the handles/hyperlinks to channels. I don't think there is anything we can do to reliably keep it consistent.

Edit: looking through the responses now to what YouTube is displaying on the website, things do seem a bit confusing. When we are using the translated title it's coming from microformats (in the player response), however the website seems to use the one from the videoPrimaryInfoRenderer in the next response. In theory these should be the same but in this case it isn't.

But it's not just here too. In the sidebar it's recommending me a mix with this video, but with the different title.

It definitely does seem like a YouTube bug where they failed to fully change something regarding handles in video titles.

image

A fix would be to prefer the title in the videoPrimaryInfoRenderer for translated titles for single videos if we can confirm that is what the website uses. However if not that or anything else it's a YouTube bug that they'll hopefully fix one day.

@pukkandan pukkandan added site-bug Issue with a specific website and removed question Question labels Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external issue Issue with an external tool site-bug Issue with a specific website
Projects
None yet
Development

No branches or pull requests

3 participants