[animeondemand] Fix typo and improve
authorSergey M․ <dstftw@gmail.com>
Thu, 17 Mar 2016 18:12:34 +0000 (00:12 +0600)
committerSergey M․ <dstftw@gmail.com>
Thu, 17 Mar 2016 18:13:50 +0000 (00:13 +0600)
youtube_dl/extractor/animeondemand.py

index 3631c245169cc87a655fc695cdaf5a4a7fc8f5d6..0158407f6a89a66f8b6d1a5b560dc3794b5152e3 100644 (file)
@@ -100,19 +100,19 @@ class AnimeOnDemandIE(InfoExtractor):
         entries = []
 
         for num, episode_html in enumerate(re.findall(
-                r'(?s)<h3[^>]+class="episodebox-title".+?>Episodeninhalt<', webpage)):
+                r'(?s)<h3[^>]+class="episodebox-title".+?>Episodeninhalt<', webpage), 1):
             episodebox_title = self._search_regex(
-                (r'class="episodebox-title"[^>]+title="(.+?)"',
-                 r'class="episodebox-title"[^>]+>(.+?)<'),
-                webpage, 'episodebox title', default=None)
+                (r'class="episodebox-title"[^>]+title=(["\'])(?P<title>.+?)\1',
+                 r'class="episodebox-title"[^>]+>(?P<title>.+?)<'),
+                episode_html, 'episodebox title', default=None, group='title')
             if not episodebox_title:
                 continue
 
             episode_number = int(self._search_regex(
-                r'^(?:Episode|Film)\s*(\d+)',
+                r'(?:Episode|Film)\s*(\d+)',
                 episodebox_title, 'episode number', default=num))
             episode_title = self._search_regex(
-                r'(?:Episode|Film)\s*\d+\s*-\s*(?P<title>.+?)',
+                r'(?:Episode|Film)\s*\d+\s*-\s*(.+)',
                 episodebox_title, 'episode title', default=None)
 
             video_id = 'episode-%d' % episode_number