scene release to discogs release
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

README.md 2.6KB

il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
il y a 2 ans
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. # rls-discogs
  2. scene release to discogs release
  3. # using
  4. - [fish](https://fishshell.com/)
  5. - [discogs-xml-to-elasticsearch](https://github.com/SuperToma/discogs-xml-to-elasticsearch)
  6. - [curl](https://curl.se/)
  7. - [jq](https://stedolan.github.io/jq/)
  8. - [websocat](https://github.com/vi/websocat)
  9. # flow
  10. scene rls name > parse > artist / title / year as .tsv > search discogs > .json
  11. # tools
  12. - `in-ws-predb.ovh.sh` read scene release names from predb websocket
  13. - `parse-rls.fish` parse scene release name
  14. - `search-discogs-api.fish` search discogs release using Discogs REST API
  15. - `search-discogs-elastic.fish` search discogs release using ElasticSearch
  16. - `search-deezer-api.fish` search for album with Deezer REST API
  17. - `out-fallback.jq` fallback search helper
  18. - `out-ids.jq` filter ids from json output
  19. - `out-simple.jq` filter genre from json output
  20. # usage
  21. parse rls name as tab separated values
  22. ```sh
  23. $ echo 'Kraftwerk-Autobahn-Remastered-CD-FLAC-2009-BCC' | ./parse-rls.fish | column -t -s "$(printf '\t')"
  24. Kraftwerk-Autobahn-Remastered-CD-FLAC-2009-BCC Kraftwerk Autobahn CD Remastered 2009
  25. ```
  26. parse rls name as json
  27. ```sh
  28. $ echo 'Kraftwerk-Autobahn-Remastered-CD-FLAC-2009-BCC' | ./parse-rls.fish -j | jq .
  29. {
  30. "artist": "Kraftwerk",
  31. "barcode": null,
  32. "catno": null,
  33. "edition": "Remastered",
  34. "format": "CD",
  35. "rls": "Kraftwerk-Autobahn-Remastered-CD-FLAC-2009-BCC",
  36. "title": "Autobahn",
  37. "year": "2009"
  38. }
  39. ```
  40. parse rls name, search local ElasticSearch, output discogs ids
  41. ```sh
  42. $ echo 'Kraftwerk-Autobahn-Remastered-CD-FLAC-2009-BCC' | ./parse-rls.fish | ./search-discogs-elastic.fish | ./out-ids.jq
  43. {"artist_id":4654,"master_id":2994,"release_id":1966322,"rls":"Kraftwerk-Autobahn-Remastered-CD-FLAC-2009-BCC"}
  44. ```
  45. get rls names from websocket, parse rls name, search with api.discogs.com, write .json
  46. ```sh
  47. $ ./in-ws-predb.ovh.sh | ./parse-rls.fish | search-discogs-api.fish > out.api.json
  48. ```
  49. parse rls name, search local ElasticSearch, write json, filter empty results and convert json to tsv, fallback search with Discogs API, write json
  50. ```sh
  51. $ echo 'Band_Of_Horses-Things_Are_Great-CD-2022-FATHEAD' | ./parse-rls.fish | ./search-discogs-elastic.fish | \
  52. tee out.es.json | ./out-fallback.jq | ./search-discogs-api.fish > out.api.json
  53. $ jq ._search_result_count out.es.json out.api.json
  54. 0
  55. 1
  56. ```
  57. With fish shell:
  58. parse rls names from local folder, search Deezer, filter cover URL, download cover image into local folder
  59. ```sh
  60. ls -1 /path/ | ./parse-rls.fish | ./search-deezer-api.fish | ./out-deezer-cover.jq | while read -l RLS COVER ; if not test -f "/path/$RLS/cover.jpg"; curl -s -o "/path/$RLS/cover.jpg" "$COVER"; end; end
  61. ```