-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
84 lines (58 loc) · 3.48 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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
72
73
74
75
76
77
78
79
80
81
82
83
84
=== What is hplaylist? ===
This is a utility for extracting the contents of an iTunes playlist
and copying the associated files to an external MP3 player. I've
tested this with a Sansa Clip running Rockbox, but any player that
mounts like a USB disk and uses a similar directory structure should
work. It assumes that playlists live in a folder called "Playlists"
in the root player directory and music files live in a folder called
"Music" in the root player directory. The Music folder can be (and is)
organized according to artist and album. It should be easy to change
the code to reflect a different directory structure. Patches to make
this configurable rather than requiring source modifications would be
welcome.
The AppleScript contained in Applescript.hs does all the real work of
dumping the contents of an iTunes playlist to a file. This code is
adapter from Bery Rinaldo's "Export Playlist to M3U" script, found at:
http://homepage.mac.com/beryrinaldo/AudioTron/Export_Playlist_to_M3U/
Due to the use of AppleScript, I expect that this application is Mac-
only. But I would welcome patches to make it work on other platforms.
=== Installation ===
$ runhaskell Setup configure --configure-option=--music-player-root=/Volumes/SANSA\ CLIP \
--configure-option=--m4a-dir=/Users/tjc/converted
$ runhaskell Setup build
$ sudo runhaskell Setup install
In place of "/Volumes/SANSA\ CLIP", substitute where your machine mounts your music player.
In place of /Users/tjc/converted, substitute a cache directory containing .mp3 files. If you
supply this config-time option and your playlist contains .m4a files, hplaylist will look
in the cache directory for a corresponding .mp3 files instead of in wherever iTunes claims
the file is. This is meant to support devices that can't play .m4a files. You can omit
the --m4a-dir option, but you must supply the --music-player-root option.
=== Usage ===
$ hplaylist "gym February 2011"
where the name in quotes is the name of an iTunes playlist. You can also do:
$ hplaylist --dry-run "gym February 2011"
and instead of copying files directly to your device, hplaylist will generate a
shell script that, when executed, copies all the files in the "gym February 2011"
playlist. For example, hplaylist might print out:
To copy the files, execute the script /var/folders/Ig/Ig9WMUQwHsWDznqEdIsAfU+++TI/-Tmp-/hplaylist_copyit5084
and then you could read the file /var/folders/Ig/Ig9WMUQwHsWDznqEdIsAfU+++TI/-Tmp-/hplaylist_copyit5084
before you execute it, to make sure everything looks OK.
==== Flags ====
--dry-run doesn't change any files on your device, but rather,
creates a shell script that can be executed to copy the files.
--quiet suppresses most output from hplaylist.
--keep-temp-files stops intermediate files from being
deleted (mostly for developers).
--temp-dir DIRECTORY attempts to store any files that are created
in DIRECTORY. By default, hplaylist uses the current directory.
=== Gotchas ===
hplaylist will not delete any existing files on your player. It also won't clobber
files with the same name that already exist. I usually just delete everything using
the Finder, and run hplaylist to set things up afresh.
=== Github page ===
https://github.com/catamorphism/hplaylist
=== Known issues ===
Filenames containing special characters do not currently get escaped correctly. Such files
get ignored. You'll have to rename your Moxy Früvous tracks or copy them by hand.
=== Further questions ===
Patches, bug reports: Tim Chevalier <[email protected]>