Giter VIP home page Giter VIP logo

lasttolibre's Introduction

Python3 adaptation for scripts from lasttolibre project

Cloned from here: https://gitlab.com/aucampia/fmthings-lasttolibre/

Original location: https://gitorious.org/fmthings/lasttolibre/blobs/raw/master/lastexport.py (unavailable on the day of writing)

I've actually fully updated and tested only lastexport.py. For other's I've just run 2to3 and haven't actually tested them. So be carefull with them. Reports on their status or pull requests are welcome.

Instructions

How to use the lastexport and libreimport scripts to create a dump of your last.fm tracks and importing them to libre.fm

Script Overview

lastexport.py - Used for exporting your listening history (also loved/banned tracks) from last.fm or libre.fm to a text file.

libreimport.py and scrobble.py - Used for importing your tracks from a text file (created with lastexport.py) to libre.fm or any other service using GNU FM software.

libreimport2.py - Used for importing loved/banned tracks to libre.fm or any other service using GNU FM software

If the scripts are not already executable, you might want to run:

cd /path/to/lasttolibre/
chmod +x *.py

Using lastexport

You will need to verify that your track history and real-time listening data are both publicly available in your Last.fm Privacy Settings

To export all your tracks from last.fm, run:

./lastexport.py --user your_lastfm_username

The tracks will be exported to exported_tracks.txt by default, where each line represents a track with the following entries (if they exist), separated by a tab:

date    trackname    artistname    albumname    trackmbid    artistmbid    albummbid

That is usually all you need to know.

Additional options

lastexport.py also recognizes the options --page, --outfile and --server.

--page lets you choose which page to start on.

Let's say you have a total of 300 pages of tracks but lastexport.py fails to download page 123, lastexport.py will then save the 122 pages you already have and quit.

You can then run lastexport.py again with:

./lastexport.py -u your_lastfm_username --page 123

And it will continue downloading tracks starting at page 123 and save them in the same file as the other 122 pages of tracks.

--outfile lets you specify a file name where the exported tracks will be saved, instead of the default exported_tracks.txt:

./lastexport.py -u your_lastfm_username --outfile mytracks.txt

--server lets you specify which server to export track info from, last.fm is the default but you can also export from libre.fm or any other gnu.fm server.

./lastexport -u your_librefm_username -s libre.fm

or

./lastexport -u your_gnufm_username -s myowngnufmserver.net

--type lets you specify which type of data you want to export, scrobbles is the default but you can also export loved or banned tracks.

./lastexport.py -u your_librefm_username -s librefm -t loved -o mylovedtracks.txt

Using libreimport (scrobble import)

To import all your tracks to libre.fm, run:

./libreimport.py your_librefm_username exported_tracks.txt

You can also specify which server to upload to with -s.

./libreimport.py -s http://mygnufmserver.com/ your_username

Using libreimport2 (loved/banned import)

To import your loved tracks to libre.fm, run:

./libreimport2.py -u your_librefm_username -t loved -f mylovedtracks.txt

or for banned tracks:

./libreimport2.py -u your_librefm_username -t banned -f mybannedtracks.txt

You will be prompted for your libre.fm password and the tracks will then get uploaded.

By default it will import your tracks to libre.fm but you can specify another server to upload to with -s mygnufmserver or --server=mygnufmserver.

lasttolibre's People

Contributors

encukou avatar kabniel avatar lantrix avatar mockobject avatar srguglielmo avatar stvad avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.