nims11 / ipod-shuffle-4g Goto Github PK
View Code? Open in Web Editor NEW4th gen IPod Shuffle songs and playlist tool.
License: GNU General Public License v2.0
4th gen IPod Shuffle songs and playlist tool.
License: GNU General Public License v2.0
I am wondering if it would be possible to place the mp3 file in a directory outside the ipod and then transfer them. We could then also reduce the filesize with compressing the files.
Itunes also has this option and I really appreciated this. I normally only have 320kb/s mp3, but on an ipod it its really low space. Having an option for 192kb/s or others would be really nice. If you dont need to manually do it and just select a folder from your music library, copy and shrink it, that'd be perfect.
Any chance to see this?
gTTS (Google Text-to-Speech) can provide very naturally sounding TTS. Would you be interested in gTTS support? I can program this if a pull request would be accepted.
Brazilian portuguese and french is the important languages for me.
My procedure:
-remove all the files from the shuffle
-boot in windows so it regenerates the control folder
-boot in linux and copy a folder to the mount point of the ipod, then run the script
# /root/.p/ipod-shuffle-4g/2016q4/ipod-shuffle-4g.py .
# the pwd is the mount point where the control folder is and where my music folder is placed as well
drwxr-xr-x 2 root root 16K Jan 1 2016 dos-ep
drwxr-xr-x 6 root root 16K Mar 22 14:06 iPod_Control
the output is:
Database written successfully:
Tracks 0
Albums 0
Artists 0
Playlists 0
How about checking whether pico2wav is available or not, and automatically disable voiceover if not ?
I'll try to get a patch up when I got some time.
I'd like to discuss the voiceover feature:
If you ask me I prefer to disable it by default. This also makes the script independent from any voiceover dependencies. Voiceover just uses more storage capacity of the limited 2gb. So why not disable it by default?
And the 2nd point is: We could enable voiceover for tracks and playlists separately. This gives us a lot advantages:
So we need to add those features:
2to3 -w filename.py
can be used to autoconvert the script. However this gives a few errors, as not all is translated correct.
Edit: it took some time but I think i managed to get the code working. I have not tested all options yet though. Please test release 1.5
does it possible to support 2 gen of ipod shuffle?
As we all know, today more than ever before, it is crucial to be able to trust our computing environments. One of the main difficulties that package maintainers of Linux distributions face, is the difficulty to verify the authenticity and the integrity of the source code.
The Arch Linux team would appreciate it if you would provide us GPG signatures in order to verify easily and quickly of your source code releases.
Overview of the required tasks:
Additional Information:
Thanks.
I am so lazy I just want to automatically find the ipod directory. We could just scan all available mount points and check for s specific folder structure there. If more than 2 mountpoints suits we can make a selection or simply abort and give a message that more than 1 was found and you need to specify which you want to use.
First of all thank you for writing this nice little program.
It would be very handy if IPod-Shuffle-4g would normalise mp3 volume before applying the gain; for example by subprocessing mp3gain.
Hello,
This is a great script! It worked fine the first time. But now I added more music files and it throws an error after processing some files:
$ python shuffle.py --disable-voiceover /media/IPOD/
...
[*] Adding track /media/IPOD/Lágrimas e chuvas.mp3
Traceback (most recent call last):
File "shuffle.py", line 480, in <module>
shuffle.write_database()
File "shuffle.py", line 435, in write_database
f.write(self.tunessd.construct())
File "shuffle.py", line 143, in construct
track_header = self.track_header.construct()
File "shuffle.py", line 178, in construct
track.populate(i)
File "shuffle.py", line 249, in populate
self["dbid"] = hashlib.md5(text.encode("ascii", "ignore")).digest()[:8] #pylint: disable-msg=E1101
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
$
I am guessing it has something do do with the accented characters..
Do you have any idea how to solve this?
thanks!
I've recently switch to another machine with Debian 8.0. Previously I ran Debian 7.X and everything was fine.
Now, I get an error:
http://pastebin.com/raw.php?i=EFzYR47x
When there are no files, IPOD sync withour error.
Mozilla has a new TTS library, which produces better quality tts than espeak or pico2wave. Maybe it would be worth integrating
https://github.com/mozilla/TTS
It would be a nice feature to automaticly convert flac to m4a (or any other lossless ipod compatible format).
I've got a lots of flac albums which I had encoded a while ago and I don't really want to encode them all once again.
There is a fork with some improvements to the voiceover. We should have a look and maybe integrate those fixes?
thomas-hori@0a72c11
First off, thank you for sharing this absolutely fantastic little script, and I hope I can be forgiven for asking for help here, although this isn't strictly a bug:
This morning, my iPod was "full" – really, the hidden Trash folder was, but I didn't know of its existence at the time. Annoyed and a bit cavalierly, I reformatted the device (as GPT with a single FAT partition). Now I can add files again and run your script without problems. However, when I switch the thing on the LED lights up red and the voice says "Please use iTunes to restore this iPod."
I am hoping that someone might be able to share their partition configuration with me, and chime in with any ideas about what exactly the iPod firmware may be looking for? 🙇♂️
Rhythmbox organizes files inside iPod using ID3 tags. ID3 tags has UTF8 characters, as "é", ´"á", "ã", etc. The .pls files and .mp3 files are right in iPod, but IPod-Shuffle-4g, when creating playlists in database, ignore this files.
https://packaging.python.org/distributing/
Package and distribute the project the way it is supposed to.
It would be nice to create a playlist for each folder. Or at least somehow set a marker.
Lets say you have:
Eminem
-album1
-album2
-album3
David Guetta
-album1
-album2
It would be nice to have per interpret playlists. But maybe one also only want a single album as playlist. So maybe placing a .playlist
inside the folder just creates a playlist for the folder and all its subfolders.
Another question:
Is it also possible to enable voiceover for playlist names (havent tried voiceover yet)? The best would be to use voiceover for playlists but not for the songs as it takes too much data. But then you could have tons of playlists which are not names just "playlist 1,2,3...".
New links for Mutagen:
https://github.com/quodlibet/mutagen
https://mutagen.readthedocs.io/en/latest/
easiest install is probably python3 -m pip install mutagen for most users
Hi everyone, I'm sorry for making an extra issue for this.
I just wanted to ask, if that is the right way to use the tool:
Also do I need to keep the mp3-files in the root directory after the script ran through or can I remove them?
Sorry those questions might be obvious to many people, it's just for my understanding.
I mounted the device, copied the music over in mp3 format, ran ipod-shuffle-4g.py on the mounted directory, unmounted the device. Now I can listen to all the songs, no complications, no GUIs.
Thank you so much! It was about time, I hated Apple's iTunes, that slow bloated piece of fing s.
Normally you hear a male speaker if no voiceover was selected via ITunes. Those sound files are still there ./NICO'S IPOD/iPod_Control/Speakable/Messages/
.
However I checked my old Ipod backup and it seems the ipod does not generate any database for this "non voiceover" ipod settings from itunes. So there must be a way to use the internal voices without merging the sounds and doing complicated stuff.
If I disable voiceover with your tool I only get "Playlist zero" for ALL playlists. "All Songs" disappeared and is silent.
We should be able to fix this somehow. This also means we do not have to provide the closed source male speaker voiceover, which is great. I will look at the hex output with xxd
. But I have nothing more than my backup. Not even a windows PC I could use to regenerate Itunes files.
The title is self-explanatory.
Traceback (most recent call last):
File "./shuffle.py", line 576, in <module>
shuffle.write_database()
File "./shuffle.py", line 512, in write_database
f.write(self.tunessd.construct())
File "./shuffle.py", line 212, in construct
play_header = self.play_header.construct(self.track_header.tracks)
File "./shuffle.py", line 350, in construct
construction = playlist.construct(tracks)
File "./shuffle.py", line 451, in construct
position = tracks.index(self.ipod_to_path(i))
ValueError: "/media/linuxuser/NICO'S IPOD/music/k.i.z./ganz oben/01 - duhastaufdeinenkokaturndeinegeistigbehinderteschwestergefiktmucke.mp3" is not in list
I used this within a playlist, that gave me the error. Not using playlists is file. I guess its just a too long name (or path!!) of the song. And yeah, that is an official name. K.I.Z. fucked you again ;D
The aur file at https://aur.archlinux.org/packages/ipod-shuffle-4g/ depends on mutagen-git, but the the script does not work. You should depend on python2-mutagen
Hello.
I've noticed that shuffle.py doesn't import tracks for the artists with a unicode U+2010 hyphen in their name, like in "Wu-Tang Clan" for example.
Best regards.
If /path/to/ipod/music/artist/playlist.m3u
has abc.mp3
, it should consider /path/to/ipod/music/artist/abc.mp3
rather than throwing an error.
First thank you for your amazing work! I love my iPod Shuffle 4 and wouldn't be able to sync it nowadays without this script.
Lately I have some problems generating the playlists on the iPod. I use Rhythmbox to sync, and they are also detected by gtkPod. However some randomly pop up with the name Playlist 0 for example.
Might this be caused during the latest update? I have also switched to Fedora, so the problem might also be there.
Patch in PR #7 enables WMA file listing. This works with my iPod 4G.
Example:
I've got a dir with a m3u file within an directory. When using -d switch, said directory produces 2 playlists: one from the dir, another from the playlist file.
Same for id3 option.
Expected behaviour:
m3u / pls / any other supported playlist type should be ignored when using -d / -i switch.
I'm trying to generate two different voiceover playlists for two different Genres of music. I want one for Rock, and one for Soundtrack.
However, it's not accepting playlists set up by Banshee OR Rhythmbox, with the -p and -t options.
It also won't accept any .m3u or .pls because of the relative files.
-i Rock does not work, or does -i {Genre}.
This is probably my fault because I misinterpreted the instructions, but they are still unclear. Any advice?
Traceback (most recent call last):
File "/usr/bin/ipod-shuffle-4g", line 739, in <module>
shuffle.write_database()
File "/usr/bin/ipod-shuffle-4g", line 631, in write_database
f.write(self.tunessd.construct())
Edit: This happens if the generated voiceover files exceed the space left on the ipod. Affects v1.3
I just want to mention that http://shuffle3db.wikispaces.com/iTunesSD3gen is now offline. If you find the same information someone else and update would be nice.
If you interrupt the program it will output some errors. There should be a way to catch this and shut down properly (aka closing all file handles).
This might be related to #4
When syncing my files with rhythmbox and this script, I realized that some files are correctly added to the DB but the iPod does not recognize them and, for example skips the according playlist.
I explored the issue a little bit further and I found that it occurs when non-standard characters like "ó" are found in the filename or an ID3 tag field. The interesting thing is, after I updated tags with Easytag for both v1 and v2 to be UTF-8, the file was recognized.
I guess one can easily implement a function to rewrite the tags but I wanted to ask if someone else stumbled over the same problem and knows what actually is the problem.
Since we fixed some issues and are going to fix a lot more, it would make sense to keep track of it.
I suggest to start from v1.0 (the original code you forked) and add a list of the fixes you made so far. After that you can tag new releases here:
https://github.com/nims11/IPod-Shuffle-4g/releases
Btw thx for looking into the othe issues I opened. I am currently trying to fix this disabled voiceover thing. Also I sent you an email some time ago, you must have missed it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.