80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
.*?
(\d+)\s*Kbps
(?:<br>(\d+)\s*Listeners)?
""", re.S|re.X)
#rx_homepage = re.compile('href="(http://[^"]+)"[^>]+target="_blank"')
rx_pages = re.compile('href="/stations/[-+\w%\d\s]+/page(\d+)">\d+</a>')
rx_numbers = re.compile("(\d+)")
self.parent.status("downloading category pages...")
# multiple pages
page = 1
max = int(conf.internetradio_max_pages)
max = (max if max > 1 else 1)
while page <= max:
# fetch
html = http.get(self.homepage + "stations/" + cat.lower().replace(" ", "%20") + "/" + ("page"+str(page) if page>1 else ""))
# regex parsing?
|
<
>
<
<
|
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
.*?
(\d+)\s*Kbps
(?:<br>(\d+)\s*Listeners)?
""", re.S|re.X)
#rx_homepage = re.compile('href="(http://[^"]+)"[^>]+target="_blank"')
rx_pages = re.compile('href="/stations/[-+\w%\d\s]+/page(\d+)">\d+</a>')
rx_numbers = re.compile("(\d+)")
# multiple pages
max = max(int(conf.internetradio_max_pages), 1)
page = 1
while page <= max:
# fetch
html = http.get(self.homepage + "stations/" + cat.lower().replace(" ", "%20") + "/" + ("page"+str(page) if page>1 else ""))
# regex parsing?
|