mirror of
				https://gitlab.com/ytdl-org/youtube-dl.git
				synced 2025-11-04 02:07:07 -05:00 
			
		
		
		
	[canalc2] Extract duration
This commit is contained in:
		@@ -4,6 +4,7 @@ from __future__ import unicode_literals
 | 
				
			|||||||
import re
 | 
					import re
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from .common import InfoExtractor
 | 
					from .common import InfoExtractor
 | 
				
			||||||
 | 
					from ..utils import parse_duration
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Canalc2IE(InfoExtractor):
 | 
					class Canalc2IE(InfoExtractor):
 | 
				
			||||||
@@ -42,9 +43,13 @@ class Canalc2IE(InfoExtractor):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        title = self._html_search_regex(
 | 
					        title = self._html_search_regex(
 | 
				
			||||||
            r'(?s)class="[^"]*col_description[^"]*">.*?<h3>(.*?)</h3>', webpage, 'title')
 | 
					            r'(?s)class="[^"]*col_description[^"]*">.*?<h3>(.*?)</h3>', webpage, 'title')
 | 
				
			||||||
 | 
					        duration = parse_duration(self._search_regex(
 | 
				
			||||||
 | 
					            r'id=["\']video_duree["\'][^>]*>([^<]+)',
 | 
				
			||||||
 | 
					            webpage, 'duration', fatal=False))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return {
 | 
					        return {
 | 
				
			||||||
            'id': video_id,
 | 
					            'id': video_id,
 | 
				
			||||||
            'formats': formats,
 | 
					 | 
				
			||||||
            'title': title,
 | 
					            'title': title,
 | 
				
			||||||
 | 
					            'duration': duration,
 | 
				
			||||||
 | 
					            'formats': formats,
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user