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

[extractor/vimeo] Fix #6149 vimeo playerConfig extraction - patch by @bashonly #6203

Merged
merged 4 commits into from
Feb 10, 2023
Merged

[extractor/vimeo] Fix #6149 vimeo playerConfig extraction - patch by @bashonly #6203

merged 4 commits into from
Feb 10, 2023

Conversation

LeoniePhiline
Copy link
Contributor

@LeoniePhiline LeoniePhiline commented Feb 10, 2023

IMPORTANT: PRs without the template will be CLOSED

Description of your pull request and other information

The vimeo extractor did not yet use the common def _search_json(), failing with its regex when some vimeo players left out the semicolon ; after the playerConfig JSON.

This PR, containing a patch authored by @bashonly, fixes this issue by using the more reliable _search_json().

Fixes #6149

Template

Before submitting a pull request make sure you have:

python3 test/test_download.py TestDownload.test_Vimeo_all failed with AssertionError: 'b3e7f4d2cbb53bd7dc3bb6ff4ed5cfbd' != '619b811a4417aa4abe78dc653becf511', but that looks like the test, not the code is broken.

Test output:

❯ python3 test/test_download.py TestDownload.test_Vimeo_all      
Skipping Vimeo: No longer available
Skipped test_Vimeo
[debug] Loaded 1766 extractors
[vimeo] Extracting URL: http://player.vimeo.com/video/54469442
[vimeo] 54469442: Downloading webpage
[vimeo] 54469442: Downloading akfire_interconnect_quic m3u8 information
[vimeo] 54469442: Downloading akfire_interconnect_quic m3u8 information
[vimeo] 54469442: Downloading fastly_skyfire m3u8 information
[vimeo] 54469442: Downloading fastly_skyfire m3u8 information
[vimeo] 54469442: Downloading akfire_interconnect_quic MPD information
[vimeo] 54469442: Downloading akfire_interconnect_quic MPD information
[vimeo] 54469442: Downloading fastly_skyfire MPD information
[vimeo] 54469442: Downloading fastly_skyfire MPD information
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, lang, vcodec:vp9.2(10), channels, acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, id
[info] 54469442: Downloading 1 format(s): http-1080p
[info] Writing video metadata as JSON to: test_Vimeo_1_54469442.info.json
[debug] Invoking http downloader on "https://vod-progressive.akamaized.net/exp=1676046833~acl=%2Fvimeo-prod-skyfire-std-us%2F01%2F893%2F2%2F54469442%2F150773109.mp4~hmac=ea7f5232b97ce427391c3e7ee68fd9d0ab388b4d66e370deb01f3aa689037066/vimeo-prod-skyfire-std-us/01/893/2/54469442/150773109.mp4"
[download] Destination: test_Vimeo_1_54469442.mp4
[download] 100% of   10.00KiB in 00:00:00 at 148.42KiB/s
F
======================================================================
FAIL: test_Vimeo_all (__main__.TestDownload):
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/leonie/Projekte/yt-dlp-wip/test/test_download.py", line 281, in test_template
    getattr(self, test_name)()
  File "/home/leonie/Projekte/yt-dlp-wip/test/test_download.py", line 235, in test_template
    self.assertEqual(tc['md5'], md5_for_file)
AssertionError: 'b3e7f4d2cbb53bd7dc3bb6ff4ed5cfbd' != '619b811a4417aa4abe78dc653becf511'
- b3e7f4d2cbb53bd7dc3bb6ff4ed5cfbd
+ 619b811a4417aa4abe78dc653becf511


----------------------------------------------------------------------
Ran 1 test in 1.704s

FAILED (failures=1)

In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

Please ask @bashonly - I only brought in the PR to get this fixed.

What is the purpose of your pull request?

@LeoniePhiline LeoniePhiline changed the title fix: #6149 vimeo playerConfig extraction - patch by @bashonly [extractor/vimeo] Fix #6149 vimeo playerConfig extraction - patch by @bashonly Feb 10, 2023
@farcaller
Copy link

I verified this, and it works as intended (and I find it hilarious how I stumbled on this problem exactly 35 minutes ago and it took me about 6 minutes to exhaust my debugging and get to GH where I saw this PR).

@pukkandan
Copy link
Member

pukkandan commented Feb 10, 2023

python3 test/test_download.py TestDownload.test_Vimeo_all failed with AssertionError: 'b3e7f4d2cbb53bd7dc3bb6ff4ed5cfbd' != '619b811a4417aa4abe78dc653becf511', but that looks like the test, not the code is broken.

You can update the test definition

@LeoniePhiline
Copy link
Contributor Author

@pukkandan Thanks, I got further with updating a few hashes, and one 960px URL to 1280px.

However, how do I need to fix the subtitle fixtures of the following:

[debug] Loaded 1766 extractors
[vimeo] Extracting URL: http://vimeo.com/76979871
[vimeo] 76979871: Downloading webpage
[vimeo] 76979871: Downloading JSON metadata
[vimeo] 76979871: Downloading JSON metadata
[vimeo] 76979871: Checking Original video URL
[vimeo] 76979871: Downloading akfire_interconnect_quic m3u8 information
[vimeo] 76979871: Downloading akfire_interconnect_quic m3u8 information
[vimeo] 76979871: Downloading fastly_skyfire m3u8 information
[vimeo] 76979871: Downloading fastly_skyfire m3u8 information
[vimeo] 76979871: Downloading akfire_interconnect_quic MPD information
[vimeo] 76979871: Downloading akfire_interconnect_quic MPD information
[vimeo] 76979871: Downloading fastly_skyfire MPD information
[vimeo] 76979871: Downloading fastly_skyfire MPD information
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, lang, vcodec:vp9.2(10), channels, acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, id
[info] 76979871: Downloading 1 format(s): Original
[info] Writing video metadata as JSON to: test_Vimeo_4_76979871.info.json
[debug] Invoking http downloader on "https://player.vimeo.com/progressive_redirect/download/76979871/container/ccfaa6de-0af0-44cb-a61a-8ecebadb6ad1/67ae7aaa/the_new_vimeo_player_%28you_know,_for_videos%29%20%28Original%29.mov?expires=1676036752&loc=external&signature=c72e776dff806fc8a666e8ae4b643af3bc5ee35a89f3ef535663d8f4d8904a72"
[download] Destination: test_Vimeo_4_76979871.mov
[download] 100% of   10.00KiB in 00:00:00 at 31.77KiB/s
F
======================================================================
FAIL: test_Vimeo_all (__main__.TestDownload):
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/leonie/Projekte/yt-dlp-wip/test/test_download.py", line 281, in test_template
    getattr(self, test_name)()
  File "/home/leonie/Projekte/yt-dlp-wip/test/test_download.py", line 215, in test_template
    expect_info_dict(self, tc_res_dict, tc.get('info_dict', {}))
  File "/home/leonie/Projekte/yt-dlp-wip/test/helper.py", line 233, in expect_info_dict
    expect_dict(self, got_dict, expected_dict)
  File "/home/leonie/Projekte/yt-dlp-wip/test/helper.py", line 186, in expect_dict
    expect_value(self, got, expected, info_field)
  File "/home/leonie/Projekte/yt-dlp-wip/test/helper.py", line 137, in expect_value
    expect_dict(self, got, expected)
  File "/home/leonie/Projekte/yt-dlp-wip/test/helper.py", line 186, in expect_dict
    expect_value(self, got, expected, info_field)
  File "/home/leonie/Projekte/yt-dlp-wip/test/helper.py", line 139, in expect_value
    self.assertEqual(
AssertionError: 1 != 5 : Expect a list of length 1, but got a list of length 5 for field de

----------------------------------------------------------------------
Ran 1 test in 15.988s

FAILED (failures=1)

Also, should these fixes really be part of this PR? Apparently nobody is running these tests - not even CI. The failing tests have nothing to do with this PR.

@pukkandan
Copy link
Member

Apparently nobody is running these tests - not even CI.

Download tests are only expected to be run by devs when editing the IE. It's appreciated if you can fix the tests assuming the failures are only due to changing test definitions. But I'll merge the PR even if you don't

@LeoniePhiline
Copy link
Contributor Author

@pukkandan I fixed some tests, see a3048b1

To fix more I don't have enough knowledge about the test suite. See my previous comment.

@pukkandan pukkandan merged commit c0cd13f into yt-dlp:master Feb 10, 2023
@LeoniePhiline
Copy link
Contributor Author

🎉

@mrzenwiz
Copy link

This is wonderful news. Any estimate on when a new release will be forthcoming?

@farcaller
Copy link

I have a temporary build in place for nix that includes this patch, so if you happen to have nix (the package manager, not the os), then you can grab it with nix profile install github:farcaller/nixpkgs/yt-dlp#yt-dlp

@ewebgh33
Copy link

Ah great, I was searching for problems with Vimeo downloading, looks like I just need to wait a few days and update YTDLP.
Thanks

@mrzenwiz

This comment was marked as off-topic.

@farcaller

This comment was marked as off-topic.

aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this pull request Apr 21, 2024
Authored by: bashonly, LeoniePhiline
Closes yt-dlp#6149
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.

[vimeo] Unable to extract info section
6 participants