Skip to content

Commit

Permalink
mtvnn: download the right number of episodes
Browse files Browse the repository at this point in the history
this fixes #132
  • Loading branch information
spaam committed Sep 27, 2014
1 parent fdd0973 commit ea057fc
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/svtplay_dl/service/mtvnn.py
Expand Up @@ -48,11 +48,18 @@ def find_all_episodes(self, options):
log.error("Couldn't program id")
sys.exit(2)
programid = match.group(1)
match = re.findall(r"data-item-id='([^']+)'", self.get_urldata())
match = re.findall(r"<li class='(divider playlist-item|playlist-item)'( data-item-id='([^']+)')?", self.get_urldata())
if not match:
log.error("Couldn't retrieve episode list")
sys.exit(2)
episodNr = []
for i in match:
if i[0] == "playlist-item":
episodNr.append(i[2])
else:
break

episodes = []
for i in sorted(match):
for i in sorted(episodNr):
episodes.append("http://www.nickelodeon.se/serier/%s-something/videos/%s-something" % (programid, i))
return episodes

0 comments on commit ea057fc

Please sign in to comment.