Check-in [c6416a18df]
Overview
Comment: | Bring back .base_url instead of .homepage property for HTTP requests. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
c6416a18dfad3f38d2abe964eb244802 |
User & Date: | mario on 2015-04-19 16:31:37 |
Other Links: | manifest | tags |
Context
2015-04-19
| ||
16:33 | Semi-fix for brand-new initialization. Set default category from existing categories[] list. Setting the displayed path as well doesn't work yet. (It's just half-way selected after the next restart.) check-in: 1cfacd1296 user: mario tags: trunk | |
16:31 | Bring back .base_url instead of .homepage property for HTTP requests. check-in: c6416a18df user: mario tags: trunk | |
16:31 | Simplify uikit.do() callback for GUI updates from within threads. Search plugin led to a memory corruption due to not using it for updates. check-in: aa264c28e2 user: mario tags: trunk | |
Changes
Modified channels/internet_radio.py from [3b80b93221] to [32acc0c3fa].
︙ | ︙ | |||
37 38 39 40 41 42 43 44 45 46 47 48 | # streams and gui class internet_radio (ChannelPlugin): # control data listformat = "pls" categories = [] # load genres def update_categories(self): | > | | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | # streams and gui class internet_radio (ChannelPlugin): # control data listformat = "pls" categories = [] base_url = "http://www.internet-radio.com/" # load genres def update_categories(self): html = http.get(self.base_url) rx = re.compile("""="/stations/[-+&.\w\s%]+/">([^<]+)<""") cats = rx.findall(html) cats = list(set(cats)) cats = [s.capitalize() for s in cats] self.categories = sorted(list(set(cats))) |
︙ | ︙ | |||
67 68 69 70 71 72 73 | html = [] max_pages = max(int(conf.internetradio_max_pages), 1) for page in range(1, max_pages): # Append HTML source html.append( http.get( | | | 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | html = [] max_pages = max(int(conf.internetradio_max_pages), 1) for page in range(1, max_pages): # Append HTML source html.append( http.get( self.base_url + "stations/" + cat.lower().replace(" ", "%20") + "/" + ("page"+str(page) if page>1 else "") ) ) # Is there a next page? if str(page+1) not in rx_pages.findall(html[-1]): |
︙ | ︙ |