75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
# regexp lists out, just one srv url per entry
ls = re.findall(r"""
^\s*([\w\s.-]+)\s*==+\s+
(?: ^\[(http[^\s\]]+) .*? \{(\w+)\} )?
.*?
^\{\{\{
.*?
(\w+://[^"'\s]+)
""", src, re.X|re.S|re.M)
# pack into row list
return [
dict(genre=g, title=t, url=u, homepage=h, bitrate=0, listeners=0, format=f, listformat="href")
for t,h,g,u in ls
]
|
|
|
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
# regexp lists out, just one srv url per entry
ls = re.findall(r"""
^\s*([\w\s.-]+)\s*==+\s+
(?: ^\[(http[^\s\]]+) .*? \{(\w+)\} )?
.*?
^\{\{\{
.*?
(\w+://[^"'\s\}\)\]]+)
""", src, re.X|re.S|re.M)
# pack into row list
return [
dict(genre=g, title=t, url=u, homepage=h, bitrate=0, listeners=0, format=f, listformat="href")
for t,h,g,u in ls
]
|