Support rendering JS before attempting to extract. #22690

Open
opened 2026-02-21 11:06:35 -05:00 by deekerman · 1 comment
Owner

Originally created by @jtagcat on GitHub (Jan 21, 2021).

Checklist

  • I'm reporting a feature request
  • I've verified that I'm running youtube-dl version 2021.01.16
  • I've searched the bugtracker for similar feature requests including closed ones

Description

Vimeo extractor for embedded pages needs to be called from the page embedding it. Problem is, ydl doesn't render JS, and the page makes the video appear only after rendering the jQuery:

<script type="text/javascript">

	jQuery(document).ready(function() {
		var video_target = 'https://maailmakool.ee/?download_file=16572&order=wc_order_AY21DpMoz3a9Y&email=tiia%40akg.vil.ee&key=0cad466f2e85701a945cf80f43b2f085';
		jQuery.ajax({
			url: video_target,
			success: function(result) {
				if (typeof(result.video_redirect) != 'undefined') {
					window.location.href = result.video_redirect;
				} else {
					jQuery('iframe#video_iframe').attr('src', 'https://player.vimeo.com/video/' + result.video_id + '?texttrack=et');
				}
			}, complete: function(result) {
				if (typeof(result.responseJSON) != 'undefined' && result.responseJSON) {
					if (typeof(result.responseJSON.code) != 'undefined' && result.responseJSON.code == 'wp_die') {
						jQuery('#video_iframe').remove();
						jQuery('#video_title').replaceWith(result.responseJSON.message);
					}
				} else {
					window.location.href = mk_embedder.root;
				}
			}, dataType: 'json'
		});
	});

	</script>
	<iframe id="video_iframe" width="1080" height="608" frameborder="0" allow="fullscreen" allowfullscreen></iframe>

A workaround could only be implemented for Vimeo, but I'd say that implementing this feature would possibly fix (in the future) many other extractors, simply by rendering JS.

Originally created by @jtagcat on GitHub (Jan 21, 2021). ## Checklist - [x] I'm reporting a feature request - [x] I've verified that I'm running youtube-dl version **2021.01.16** - [x] I've searched the bugtracker for similar feature requests including closed ones ## Description Vimeo extractor for embedded pages needs to be called from the page embedding it. Problem is, ydl doesn't render JS, and the page makes the video appear only after rendering the jQuery: ``` <script type="text/javascript"> jQuery(document).ready(function() { var video_target = 'https://maailmakool.ee/?download_file=16572&order=wc_order_AY21DpMoz3a9Y&email=tiia%40akg.vil.ee&key=0cad466f2e85701a945cf80f43b2f085'; jQuery.ajax({ url: video_target, success: function(result) { if (typeof(result.video_redirect) != 'undefined') { window.location.href = result.video_redirect; } else { jQuery('iframe#video_iframe').attr('src', 'https://player.vimeo.com/video/' + result.video_id + '?texttrack=et'); } }, complete: function(result) { if (typeof(result.responseJSON) != 'undefined' && result.responseJSON) { if (typeof(result.responseJSON.code) != 'undefined' && result.responseJSON.code == 'wp_die') { jQuery('#video_iframe').remove(); jQuery('#video_title').replaceWith(result.responseJSON.message); } } else { window.location.href = mk_embedder.root; } }, dataType: 'json' }); }); </script> <iframe id="video_iframe" width="1080" height="608" frameborder="0" allow="fullscreen" allowfullscreen></iframe> ``` A workaround could only be implemented for Vimeo, but I'd say that implementing this feature would possibly fix (in the future) many other extractors, simply by rendering JS.
Author
Owner

@jtagcat commented on GitHub (Jan 21, 2021):

Source: #11196

@jtagcat commented on GitHub (Jan 21, 2021): Source: #11196
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl#22690
No description provided.