mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-24 04:05:39 +01:00
svtplay: all episodes for öppet arkiv.
This commit is contained in:
parent
9303550de1
commit
cba3bed554
@ -119,6 +119,32 @@ class Svtplay(Service, OpenGraphThumbMixin):
|
||||
|
||||
|
||||
def find_all_episodes(self, options):
|
||||
parse = urlparse(self.url)
|
||||
if parse.netloc == "www.oppetarkiv.se":
|
||||
page = 1
|
||||
match = re.search(r'"http://www.oppetarkiv.se/etikett/titel/([^"/]+)', self.get_urldata())
|
||||
if match is None:
|
||||
match = re.search(r'"http://www.oppetarkiv.se/etikett/titel/([^"/]+)', self.url)
|
||||
if match is None:
|
||||
log.error("Couldn't find title")
|
||||
sys.exit(2)
|
||||
program = match.group(1)
|
||||
more = True
|
||||
episodes = []
|
||||
while more:
|
||||
url = "http://www.oppetarkiv.se/etikett/titel/%s/?sida=%s&sort=tid_stigande&embed=true" % (program, page)
|
||||
data = get_http_data(url)
|
||||
visa = re.search(r'svtXColorDarkLightGrey', data)
|
||||
if not visa:
|
||||
more = False
|
||||
regex = re.compile(r'(http://www.oppetarkiv.se/video/[^"]+)')
|
||||
for match in regex.finditer(data):
|
||||
episodes.append(match.group(1))
|
||||
page += 1
|
||||
|
||||
return episodes
|
||||
|
||||
else:
|
||||
match = re.search(r'<link rel="alternate" type="application/rss\+xml" [^>]*href="([^"]+)"',
|
||||
self.get_urldata())
|
||||
if match is None:
|
||||
|
Loading…
Reference in New Issue
Block a user