Check-in [220ee1286a]
Overview
Comment: | Exchange audio/mp3 for standard audio/mpeg MIME type. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
220ee1286a7b08ab5b75daf426749b9e |
User & Date: | mario on 2014-05-13 21:00:06 |
Other Links: | manifest | tags |
Context
2014-05-13
| ||
21:04 | Mirror config dialog changes to Gtk3 ui file check-in: 74bf77f074 user: mario tags: trunk | |
21:00 | Exchange audio/mp3 for standard audio/mpeg MIME type. check-in: 220ee1286a user: mario tags: trunk | |
19:58 | Some surfmusik category fixes, support for TV channel retrieval check-in: 3e7da2fdba user: mario tags: trunk | |
Changes
Modified action.py from [a3c14ebdbb] to [5d3890f993].
︙ | |||
37 38 39 40 41 42 43 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | - + | # but also "browser" for web URLs # class action: # streamlink formats lt = {"asx":"video/x-ms-asf", "pls":"audio/x-scpls", "m3u":"audio/x-mpegurl", "xspf":"application/xspf+xml", "href":"url/http", "ram":"audio/x-pn-realaudio", "smil":"application/smil"} # media formats |
︙ | |||
59 60 61 62 63 64 65 | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | - + - - + + - + | return str(s) # should actually be "\\\"%s\\\"" % s else: return "%r" % str(s) # calls player for stream url and format @staticmethod |
︙ | |||
207 208 209 210 211 212 213 | 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | - + | # extract stream address from .pls URL if (re.search("\.pls", pls)): #audio/x-scpls return action.pls(pls) elif (re.search("\.asx", pls)): #video/x-ms-asf return re.findall("<Ref\s+href=\"(http://.+?)\"", http.get(pls)) elif (re.search("\.m3u|\.ram|\.smil", pls)): #audio/x-mpegurl return re.findall("(http://[^\s]+)", http.get(pls), re.I) |
︙ |
Modified channels/_generic.py from [3af550db05] to [e7ef47afa8].
︙ | |||
48 49 50 51 52 53 54 | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | - + | # desc module = "generic" title = "GenericChannel" homepage = "http://milki.inlcude-once.org/streamtuner2/" base_url = "" listformat = "audio/x-scpls" |
︙ | |||
427 428 429 430 431 432 433 | 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 | - + - + | # convert audio format nick/shortnames to mime types, e.g. "OGG" to "audio/ogg" def mime_fmt(self, s): # clean string s = s.lower().strip() # rename map = { |
︙ |
Modified channels/internet_radio_org_uk.py from [2ca4dac6b1] to [f41506948c].
︙ | |||
108 109 110 111 112 113 114 | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | - + - + | "url": url, "genre": self.strip_tags(genre), "homepage": http.fix_url(homepage), "title": title, "playing": playing, "bitrate": int(bitrate), "listeners": int(listeners if listeners else 0), |
︙ |
Modified channels/punkcast.py from [e751e37b9b] to [0e12904925].
︙ | |||
70 71 72 73 74 75 76 | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | - + | #-- all from frontpage for uu in rx_link.findall(http.get(self.homepage)): (homepage, id, title) = uu entries.append({ "genre": "?", "title": title, "playing": "PUNKCAST #"+id, |
︙ |
Modified channels/timer.py from [57941064a8] to [5079381818].
︙ | |||
162 163 164 165 166 167 168 | 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | - + - + | except: return 0 # no limit # action wrapper def play(self, row, *args, **kwargs): action.play( url = row["url"], |
Modified cli.py from [ea53579a96] to [b62ad1b334].
︙ | |||
105 106 107 108 109 110 111 | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | - + | if row.get("url"): print(row["url"]) # run player def play(self, *args): row = self.stream(*args) if row.get("url"): |
︙ |
Modified config.py from [9f0935794a] to [5e2372f9f1].
︙ | |||
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | + - + | dirs = ["/usr/share/streamtuner2", "/usr/local/share/streamtuner2", sys.path[0], "."] self.share = [d for d in dirs if os.path.exists(d)][0] # settings from last session last = self.load("settings") if (last): self.update(last) self.migrate() # store defaults in file else: self.save("settings") self.firstrun = 1 # some defaults def defaults(self): self.browser = "sensible-browser" self.play = { |
︙ | |||
176 177 178 179 180 181 182 183 184 185 186 187 188 189 | 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | + + + + + + + | for key,value in with_new_data.items(): if type(value) == dict: self[key].update(value) else: self[key] = value # descends into sub-dicts instead of wiping them with subkeys # update old setting names def migrate(self): # 2.1.1 if "audio/mp3" in self.play: self.play["audio/mpeg"] = self.play["audio/mp3"] del self.play["audio/mp3"] # check for existing filename in directory list def find_in_dirs(self, dirs, file): for d in dirs: if os.path.exists(d+"/"+file): return d+"/"+file |
︙ |
Modified gtk2.xml from [17490ef6c9] to [99e1222436].
︙ | |||
1214 1215 1216 1217 1218 1219 1220 | 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 | - + | <property name="left_attach">1</property> <property name="right_attach">2</property> <property name="top_attach">12</property> <property name="bottom_attach">13</property> </packing> </child> <child> |
︙ | |||
1237 1238 1239 1240 1241 1242 1243 | 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 | - + + | <property name="bottom_attach">2</property> </packing> </child> <child> <object class="GtkLabel" id="label7"> <property name="visible">True</property> <property name="can_focus">False</property> |
︙ |
Modified st2.py from [6bfb3a77f9] to [22d6d5d44f].
︙ | |||
310 311 312 313 314 315 316 | 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 | - + | self.channel().play(row) favicon.download_playing(row) # streamripper def on_record_clicked(self, widget): row = self.row() |
︙ | |||
721 722 723 724 725 726 727 | 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 | - + | main.channel().save() self.cancel(w) # add a new list entry, update window def new(self, w): s = main.channel().stations() |
︙ | |||
766 767 768 769 770 771 772 | 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 | - + | # set/load values between gtk window and conf. dict def apply(self, config, prefix="config_", save=0): for key,val in config.items(): # map non-alphanumeric chars from config{} to underscores in according gtk widget names id = re.sub("[^\w]", "_", key) w = main.get_widget(prefix + id) __print__(dbg.CONF, "config", ("save" if save else "load"), prefix+id, w, val) |
︙ |