Check-in [3e718937a3]
Overview
Comment: | Implement jamendo APIs new `download_allowed` flags (as simple state icons here - purely visual, not actually affecting download button / not even sure if streamripper works on all entry types). |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
3e718937a3fd118c484203f382f7fdcf |
User & Date: | mario on 2021-01-30 10:31:02 |
Other Links: | manifest | tags |
Context
2021-02-06
| ||
15:03 | Update for changed itemtype= url (https) check-in: 0cfc0c113b user: mario tags: trunk | |
2021-01-30
| ||
10:31 | Implement jamendo APIs new `download_allowed` flags (as simple state icons here - purely visual, not actually affecting download button / not even sure if streamripper works on all entry types). check-in: 3e718937a3 user: mario tags: trunk | |
2020-12-28
| ||
19:49 | Update for recent change, but also implement JSON extraction while at it. check-in: 697df17183 user: mario tags: trunk | |
Changes
Modified channels/jamendo.py from [73c08be29f] to [2c513747d5].
1 2 3 4 5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | - + | # encoding: UTF-8 # api: streamtuner2 # title: Jamendo # description: A license-free music collection and artist hub. # type: channel |
︙ | |||
280 281 282 283 284 285 286 | 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | - + + + | entries.append({ "genre": radio, "title": j[0]["dispname"], "url": j[0]["stream"], #"http://streaming.jamendo.com/Jam" + radio, # optional +".m3u" "playing": "various artists", "format": "audio/mpeg", "homepage": "http://www.jamendo.com/en/radios", |
︙ | |||
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 | 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | + + | #"url": "http://api.jamendo.com/v3.0/playlists/file?client_id=%s&id=%s" % (self.cid, e["id"]), #"url": "http://api.jamendo.com/get2/stream/track/xspf/?album_id=%s&streamencoding=ogg2&n=all&from=app-%s" % (e["id"], self.cid), #"format": "audio/ogg", #"listformat": "xspf", "url": "http://api.jamendo.com/v3.0/tracks?client_id={}&audioformat={}&album_id={}".format(self.cid, fmt, e["id"]), "listformat": "jamj", "format": fmt_mime, "state": self.download_icon(e), }) # Feeds (News) elif cat == "feeds": for e in self.api(method="feeds", order="date_start_desc", target="notlogged"): if e.get("joinid") and e.get("subtitle"): entries.append({ "genre": e["type"], "title": e["title"]["en"], "playing": e["subtitle"]["en"], "extra": e["text"]["en"], "homepage": e["link"], "format": fmt_mime, "listformat": "jamj", "url": "http://api.jamendo.com/v3.0/tracks?client_id={}&audioformat={}&album_id={}".format(self.cid, fmt, e["joinid"]), "state": self.download_icon(e), }) # Genre list, or Search else: if cat: data = self.api(method="tracks", order="popularity_week", include="musicinfo", fuzzytags=cat, audioformat=fmt) elif search: |
︙ | |||
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 | + + + + + + + + + + + | "playing": e["album_name"] + " / " + e["artist_name"], "img": e["album_image"], "homepage": e["shareurl"], "url": e["audio"], #"url": "http://storage-new.newjamendo.com/?trackid=%s&format=ogg2&u=0&from=app-%s" % (e["id"], self.cid), "format": fmt_mime, "listformat": "srv", "state": self.download_icon(e), }) # done return entries # check for 'audiodownload_allowed' and whatever, set state icon def download_icon(self, e): #print(e['audiodownload_allowed']) if 'audiodownload_allowed' in e and not e['audiodownload_allowed']: return "gtk-stop" # gtk-close elif 'zip_allowed' in e and not e['zip_allowed']: return "gtk-delete" # gtk-cancel elif 'track_audiodownload_allowed' in e and not e['track_audiodownload_allowed']: return "gtk-print-paused" return None # gtk-floppy # Collect data sets from Jamendo API def api(self, method, **params): r = [] max = 200 * int(conf.jamendo_count) params = dict( list({ |
︙ |