mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-11-04 08:35:12 +00:00 
			
		
		
		
	
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							812283199a
						
					
				
				
					commit
					df635a09a4
				
			@@ -86,9 +86,14 @@ class TwitCastingIE(InfoExtractor):
 | 
				
			|||||||
            request_data = urlencode_postdata({
 | 
					            request_data = urlencode_postdata({
 | 
				
			||||||
                'password': video_password,
 | 
					                'password': video_password,
 | 
				
			||||||
            }, encoding='utf-8')
 | 
					            }, encoding='utf-8')
 | 
				
			||||||
        webpage = self._download_webpage(
 | 
					        webpage, urlh = self._download_webpage_handle(
 | 
				
			||||||
            url, video_id, data=request_data,
 | 
					            url, video_id, data=request_data,
 | 
				
			||||||
            headers={'Origin': 'https://twitcasting.tv'})
 | 
					            headers={'Origin': 'https://twitcasting.tv'})
 | 
				
			||||||
 | 
					        if urlh.geturl() != url and request_data:
 | 
				
			||||||
 | 
					            webpage = self._download_webpage(
 | 
				
			||||||
 | 
					                urlh.geturl(), video_id, data=request_data,
 | 
				
			||||||
 | 
					                headers={'Origin': 'https://twitcasting.tv'},
 | 
				
			||||||
 | 
					                note='Retrying authentication')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        title = (clean_html(get_element_by_id('movietitle', webpage))
 | 
					        title = (clean_html(get_element_by_id('movietitle', webpage))
 | 
				
			||||||
                 or self._html_search_meta(['og:title', 'twitter:title'], webpage, fatal=True))
 | 
					                 or self._html_search_meta(['og:title', 'twitter:title'], webpage, fatal=True))
 | 
				
			||||||
@@ -149,6 +154,7 @@ class TwitCastingIE(InfoExtractor):
 | 
				
			|||||||
                m3u8_url, video_id, ext='mp4', m3u8_id='hls',
 | 
					                m3u8_url, video_id, ext='mp4', m3u8_id='hls',
 | 
				
			||||||
                live=True, headers=self._M3U8_HEADERS)
 | 
					                live=True, headers=self._M3U8_HEADERS)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if traverse_obj(stream_server_data, ('hls', 'source')):
 | 
				
			||||||
                formats.extend(self._extract_m3u8_formats(
 | 
					                formats.extend(self._extract_m3u8_formats(
 | 
				
			||||||
                    m3u8_url, video_id, ext='mp4', m3u8_id='source',
 | 
					                    m3u8_url, video_id, ext='mp4', m3u8_id='source',
 | 
				
			||||||
                    live=True, query={'mode': 'source'},
 | 
					                    live=True, query={'mode': 'source'},
 | 
				
			||||||
@@ -164,11 +170,12 @@ class TwitCastingIE(InfoExtractor):
 | 
				
			|||||||
                        'format_id': 'ws-%s' % mode,
 | 
					                        'format_id': 'ws-%s' % mode,
 | 
				
			||||||
                        'ext': 'mp4',
 | 
					                        'ext': 'mp4',
 | 
				
			||||||
                        'quality': qq(mode),
 | 
					                        'quality': qq(mode),
 | 
				
			||||||
 | 
					                        'source_preference': -10,
 | 
				
			||||||
                        # TwitCasting simply sends moof atom directly over WS
 | 
					                        # TwitCasting simply sends moof atom directly over WS
 | 
				
			||||||
                        'protocol': 'websocket_frag',
 | 
					                        'protocol': 'websocket_frag',
 | 
				
			||||||
                    })
 | 
					                    })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            self._sort_formats(formats)
 | 
					            self._sort_formats(formats, ('source',))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            infodict = {
 | 
					            infodict = {
 | 
				
			||||||
                'formats': formats
 | 
					                'formats': formats
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user