mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 14:45:14 +00:00 
			
		
		
		
	[cleanup] Add more ruff rules (#10149)
Authored by: seproDev Reviewed-by: bashonly <88596187+bashonly@users.noreply.github.com> Reviewed-by: Simon Sawicki <contact@grub4k.xyz>
This commit is contained in:
		| @@ -19,7 +19,7 @@ class StanfordOpenClassroomIE(InfoExtractor): | ||||
|             'id': 'PracticalUnix_intro-environment', | ||||
|             'ext': 'mp4', | ||||
|             'title': 'Intro Environment', | ||||
|         } | ||||
|         }, | ||||
|     } | ||||
| 
 | ||||
|     def _real_extract(self, url): | ||||
| @@ -34,12 +34,12 @@ class StanfordOpenClassroomIE(InfoExtractor): | ||||
|                 'upload_date': None, | ||||
|             } | ||||
| 
 | ||||
|             baseUrl = 'http://openclassroom.stanford.edu/MainFolder/courses/' + course + '/videos/' | ||||
|             xmlUrl = baseUrl + video + '.xml' | ||||
|             mdoc = self._download_xml(xmlUrl, info['id']) | ||||
|             base_url = 'http://openclassroom.stanford.edu/MainFolder/courses/' + course + '/videos/' | ||||
|             xml_url = base_url + video + '.xml' | ||||
|             mdoc = self._download_xml(xml_url, info['id']) | ||||
|             try: | ||||
|                 info['title'] = mdoc.findall('./title')[0].text | ||||
|                 info['url'] = baseUrl + mdoc.findall('./videoFile')[0].text | ||||
|                 info['url'] = base_url + mdoc.findall('./videoFile')[0].text | ||||
|             except IndexError: | ||||
|                 raise ExtractorError('Invalid metadata XML file') | ||||
|             return info | ||||
| @@ -66,7 +66,7 @@ class StanfordOpenClassroomIE(InfoExtractor): | ||||
| 
 | ||||
|             links = orderedSet(re.findall(r'<a href="(VideoPage\.php\?[^"]+)">', coursepage)) | ||||
|             info['entries'] = [self.url_result( | ||||
|                 'http://openclassroom.stanford.edu/MainFolder/%s' % unescapeHTML(l) | ||||
|                 f'http://openclassroom.stanford.edu/MainFolder/{unescapeHTML(l)}', | ||||
|             ) for l in links] | ||||
|             return info | ||||
|         else:  # Root page | ||||
| @@ -78,12 +78,12 @@ class StanfordOpenClassroomIE(InfoExtractor): | ||||
|             } | ||||
|             info['title'] = info['id'] | ||||
| 
 | ||||
|             rootURL = 'http://openclassroom.stanford.edu/MainFolder/HomePage.php' | ||||
|             rootpage = self._download_webpage(rootURL, info['id'], | ||||
|             root_url = 'http://openclassroom.stanford.edu/MainFolder/HomePage.php' | ||||
|             rootpage = self._download_webpage(root_url, info['id'], | ||||
|                                               errnote='Unable to download course info page') | ||||
| 
 | ||||
|             links = orderedSet(re.findall(r'<a href="(CoursePage\.php\?[^"]+)">', rootpage)) | ||||
|             info['entries'] = [self.url_result( | ||||
|                 'http://openclassroom.stanford.edu/MainFolder/%s' % unescapeHTML(l) | ||||
|                 f'http://openclassroom.stanford.edu/MainFolder/{unescapeHTML(l)}', | ||||
|             ) for l in links] | ||||
|             return info | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 sepro
					sepro