mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-27 21:54:17 +01:00
svtplay: added support for direct link to rss.xml with -A
This commit is contained in:
parent
d2e9edf1e3
commit
a12ff19606
@ -175,9 +175,16 @@ class Svtplay(Service, OpenGraphThumbMixin):
|
||||
return videos
|
||||
|
||||
def find_all_episodes(self, options):
|
||||
match = re.search(r'<link rel="alternate" type="application/rss\+xml" [^>]*href="([^"]+)"',
|
||||
self.get_urldata())
|
||||
parse = urlparse(self._url)
|
||||
|
||||
if len(parse.path) > 7 and parse.path[-7:] == "rss.xml":
|
||||
match = self.url
|
||||
else:
|
||||
match = re.search(r'<link rel="alternate" type="application/rss\+xml" [^>]*href="([^"]+)"',
|
||||
self.get_urldata())
|
||||
if match:
|
||||
match = match.group(1)
|
||||
|
||||
if match is None:
|
||||
videos = []
|
||||
match = re.search('_svtplay"] = ({.*});', self.get_urldata())
|
||||
@ -204,7 +211,7 @@ class Svtplay(Service, OpenGraphThumbMixin):
|
||||
|
||||
episodes = [urljoin("http://www.svtplay.se", x) for x in videos]
|
||||
else:
|
||||
data = self.http.request("get", match.group(1)).content
|
||||
data = self.http.request("get", match).content
|
||||
xml = ET.XML(data)
|
||||
|
||||
episodes = [x.text for x in xml.findall(".//item/link")]
|
||||
|
Loading…
Reference in New Issue
Block a user