- # Chirbit has a pretty weird "Last Page" navigation behavior.
- # We grab the profile's oldest entry to determine when to
- # stop fetching entries.
- oldestpage = self._download_webpage(url + '/24599', profile_id)
- oldest_page_entries = re.findall(
- r'''soundFile:\s*"http://audio.chirbit.com/(.*?).mp3"''',
- oldestpage);
- oldestentry = clean_html(oldest_page_entries[-1]);
-
- ids = []
- titles = []
- n = 0
- while True:
- page = self._download_webpage(url + '/' + str(n), profile_id)
- page_ids = re.findall(
- r'''soundFile:\s*"http://audio.chirbit.com/(.*?).mp3"''',
- page);
- page_titles = re.findall(
- r'''<div\s+class="chirbit_title"\s*>(.*?)</div>''',
- page);
- ids += page_ids
- titles += page_titles
- if oldestentry in page_ids:
- break
- n += 1
-
- entries = []
- i = 0
- for id in ids:
- entries.append({
- 'id': id,
- 'title': titles[i],
- 'url': 'http://audio.chirbit.com/' + id + '.mp3'
- });
- i += 1
-
- info_dict = {
- '_type': 'playlist',
- 'id': profile_id,
- 'title': profile_id,
- 'entries': entries
- }
+ rss = self._download_xml(
+ 'http://chirbit.com/rss/%s' % profile_id, profile_id)
+
+ entries = [
+ self.url_result(audio_url.text, 'Chirbit')
+ for audio_url in rss.findall('./channel/item/link')]
+
+ title = rss.find('./channel/title').text