mirror of
				https://gitlab.com/ytdl-org/youtube-dl.git
				synced 2025-11-03 23:57:06 -05:00 
			
		
		
		
	[twitter] pass referer with card request(closes #18579)
This commit is contained in:
		@@ -171,7 +171,8 @@ class TwitterCardIE(TwitterBaseIE):
 | 
				
			|||||||
            urls.append('https://twitter.com/i/videos/' + video_id)
 | 
					            urls.append('https://twitter.com/i/videos/' + video_id)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        for u in urls:
 | 
					        for u in urls:
 | 
				
			||||||
            webpage = self._download_webpage(u, video_id)
 | 
					            webpage = self._download_webpage(
 | 
				
			||||||
 | 
					                u, video_id, headers={'Referer': 'https://twitter.com/'})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            iframe_url = self._html_search_regex(
 | 
					            iframe_url = self._html_search_regex(
 | 
				
			||||||
                r'<iframe[^>]+src="((?:https?:)?//(?:www\.youtube\.com/embed/[^"]+|(?:www\.)?vine\.co/v/\w+/card))"',
 | 
					                r'<iframe[^>]+src="((?:https?:)?//(?:www\.youtube\.com/embed/[^"]+|(?:www\.)?vine\.co/v/\w+/card))"',
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user