1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00

svtplay: remove rss support in find all

In rss the sorting is way wrong.
This commit is contained in:
Johan Andersson 2018-01-09 14:37:11 +01:00
parent dca6e90a80
commit 503bb540f5

View File

@ -169,37 +169,6 @@ class Svtplay(Service, OpenGraphThumbMixin):
def find_all_episodes(self, options):
parse = urlparse(self._url)
if len(parse.path) > 7 and parse.path[-7:] == "rss.xml":
rss_url = self.url
else:
rss_url = re.search(r'<link rel="alternate" type="application/rss\+xml" [^>]*href="([^"]+)"', self.get_urldata())
if rss_url:
rss_url = rss_url.group(1)
valid_rss = False
tab = None
if parse.query:
match = re.search("tab=(.+)", parse.query)
if match:
tab = match.group(1)
#Clips and tab can not be used with RSS-feed
if rss_url and not self.options.include_clips and not tab:
rss_data = self.http.request("get", rss_url).content
try:
xml = ET.XML(rss_data)
episodes = [x.text for x in xml.findall(".//item/link")]
#TODO add better checks for valid RSS-feed here
valid_rss = True
except ET.ParseError:
log.info("Error parsing RSS-feed at {0}, make sure it is a valid RSS-feed, will use other method to find episodes.".format(rss_url))
else:
#if either tab or include_clips is set remove rss.xml from url if set manually.
if len(parse.path) > 7 and parse.path[-7:] == "rss.xml":
self._url = self.url.replace("rss.xml","")
if not valid_rss:
videos = []
tab = None
match = re.search("__svtplay'] = ({.*});", self.get_urldata())