Custom feeds: change handle_url to fetch_channel
This commit is contained in:
parent
10adc4a0fc
commit
4f063851b1
|
@ -56,14 +56,14 @@ class gPodderFetcher(feedcore.Fetcher):
|
|||
custom_handlers = []
|
||||
|
||||
def fetch_channel(self, channel):
|
||||
for handler in self.custom_handlers:
|
||||
custom_feed = handler.fetch_channel(channel)
|
||||
if custom_feed is not None:
|
||||
return feedcore.Result(feedcore.CUSTOM_FEED, custom_feed)
|
||||
# If we have a username or password, rebuild the url with them included
|
||||
# Note: using a HTTPBasicAuthHandler would be pain because we need to
|
||||
# know the realm. It can be done, but I think this method works, too
|
||||
url = channel.authenticate_url(channel.url)
|
||||
for handler in self.custom_handlers:
|
||||
custom_feed = handler.handle_url(url)
|
||||
if custom_feed is not None:
|
||||
return feedcore.Result(feedcore.CUSTOM_FEED, custom_feed)
|
||||
return self.fetch(url, channel.http_etag, channel.http_last_modified)
|
||||
|
||||
def _resolve_url(self, url):
|
||||
|
|
|
@ -187,6 +187,11 @@ class SoundcloudUser(object):
|
|||
class SoundcloudFeed(object):
|
||||
URL_REGEX = re.compile('https?://([a-z]+\.)?soundcloud\.com/([^/]+)$', re.I)
|
||||
|
||||
@classmethod
|
||||
def fetch_channel(cls, channel):
|
||||
url = channel.authenticate_url(channel.url)
|
||||
return cls.handle_url(url)
|
||||
|
||||
@classmethod
|
||||
def handle_url(cls, url):
|
||||
m = cls.URL_REGEX.match(url)
|
||||
|
|
Loading…
Reference in New Issue