Commits

sillyfrog  committed 9f39b6f

Handle a newer filename format

  • Participants
  • Parent commits 78176eb

Comments (0)

Files changed (1)

File python-iview/daily_scrape.py

         episode = episode.strip()
         if episode:
             episode = ' - %s' % (episode)
-        match = re.match(r'.*_\d{2}_(\d{2})_(\d{2})\..*', show['url'])
-        seriesnum, episodenum = match.groups()
+        match = re.match(r'.*_\d{2}_(?P<series>\d{2})_(?P<episode>\d{2}(_.+)?)\..*', show['url'])
+        if not match:
+            print
+            print show
+            print
+            print "NO MATCH for url:", show['url']
+        seriesnum = match.group('series')
+        episodenum = match.group('episode')
         fn = '%s - s%se%s%s' % (showfolder(show), seriesnum, 
                 episodenum, episode)
     fn = validfilename(fn)