LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-14-2015, 09:43 AM   #31
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918

Quote:
Originally Posted by nitecrawler View Post
Code:
strings filename.mp3 | head
&&
strings filename.mp3 | tail
edited:
i dont see anything added there and my filenames remain the same as before.....
ok lets rewind a bit... you mention you got id3lib installed. did it create the requisite id3info executable ?
when you run it against an mp3 file does it print out to the screen the labels of the artist/song name/album/year/track number/... information ? e.g.:
Code:
[schneidz@hyper music]$ id3info soca/machal-mantano--single-forever.mp3 

*** Tag information for soca/machal-mantano--single-forever.mp3
=== TIT2 (Title/songname/content description): 08-single forever
=== TPE1 (Lead performer(s)/Soloist(s)): k.i. / machal montano
=== TALB (Album/Movie/Show title): carnival
=== TYER (Year): 2012
=== TRCK (Track number/Position in set): 8
*** mp3 info
MPEG1/layer III
Bitrate: 56KBps
Frequency: 48KHz
id3info is not designed to change filenames. it is designed to read id3 info from a media file and display it to the screen. a user can capture that information and use it to rename files within a bash script if they so choose.

the strings test was just a low-level way of determining if apple retained the id3 info in the individual mp3 files or if they stored them inside of some it00nz database so that users would be forced to use it00nz to determine song names.

Last edited by schneidz; 01-14-2015 at 09:51 AM.
 
Old 01-14-2015, 09:47 AM   #32
nitecrawler
Member
 
Registered: Dec 2014
Distribution: slackware x86-64 14.2
Posts: 188

Original Poster
Rep: Reputation: Disabled
Code:
id3info /mnt/my_ipod/iTunes_Control/Music/F03/ELJQ.mp3
*** Tag information for ELJQ.mp3
=== TALB (Album/Movie/Show title): The Essential Judas Priest 
=== TPE1 (Lead performer(s)/Soloist(s)): Judas Priest
=== TPE2 (Band/orchestra/accompaniment): JUDAS PRIEST
=== COMM (Comments): ()[eng]: Tags edt. by herguim
=== TCON (Content type): Heavy Metal
=== TIT2 (Title/songname/content description): Breaking The Law
=== TRCK (Track number/Position in set): 02
=== TYER (Year): 2006
=== APIC (Attached picture): ()[, 0]: image/jpeg, 67134 bytes
=== COMM (Comments): (ID3v1 Comment)[XXX]: Tags edt. by herguim
*** mp3 info
MPEG1/layer III
Bitrate: 64KBps
Frequency: 48KHz
 
Old 01-14-2015, 09:53 AM   #33
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
^ success. the next step is to extract those id3 tags into variables and loop thru your music library to rename the files into something more logical.

let us know of your progress.
 
Old 01-14-2015, 09:58 AM   #34
nitecrawler
Member
 
Registered: Dec 2014
Distribution: slackware x86-64 14.2
Posts: 188

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by schneidz View Post
id3info is not designed to change filenames. it is designed to read id3 info from a media file and display it to the screen. a user can capture that information and use it to rename files within a bash script if they so choose.

the strings test was just a low-level way of determining if apple retained the id3 info in the individual mp3 files or if they stored them inside of some it00nz database so that users would be forced to use it00nz to determine song names.
thanks for the info....and i have posted my id3info for a file...

here is the next issue i face before i write that mapping request and renaming script.....
was checking some files and found out that all files dont have tag info...for example below output....
Code:
bash-4.2# id3info TYJA.mp3 
*** Tag information for TYJA.mp3
bash-4.2#
edited: well will leave them default as is for now....

thanks...thinking of python....havent tried it yet....well this script will get me going....

Last edited by nitecrawler; 01-14-2015 at 10:03 AM.
 
Old 01-14-2015, 10:00 AM   #35
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Quote:
Originally Posted by nitecrawler View Post
thanks for the info....and i have posted my id3info for a file...

here is the next issue i face before i write that mapping request and renaming script.....
was checking some files and found out that all files dont have tag info...for example below output....
Code:
bash-4.2# id3info TYJA.mp3 
*** Tag information for TYJA.mp3
bash-4.2#
that sux... i wonder what this will show
Code:
strings TYJA.mp3 | head && strings TYJA.mp3 | tail
probably nothing but binary gibberish.

so maybe this suspicion is correct:
Quote:
Originally Posted by schneidz View Post
...
the strings test was just a low-level way of determining if apple retained the id3 info in the individual mp3 files or if they stored them inside of some it00nz database so that users would be forced to use it00nz to determine song names.
if you are really determined to get the songs off of it00n$, maybe you can hunt around in your ifone and look for any file that may resemble some song list database and try to hax thru it (knowing apple it probably wont be some easy to read text file) ?

Last edited by schneidz; 01-14-2015 at 10:07 AM.
 
Old 01-20-2015, 01:55 AM   #36
nitecrawler
Member
 
Registered: Dec 2014
Distribution: slackware x86-64 14.2
Posts: 188

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by schneidz View Post
that sux... i wonder what this will show
Code:
strings TYJA.mp3 | head && strings TYJA.mp3 | tail
probably nothing but binary gibberish.

so maybe this suspicion is correct:
if you are really determined to get the songs off of it00n$, maybe you can hunt around in your ifone and look for any file that may resemble some song list database and try to hax thru it (knowing apple it probably wont be some easy to read text file) ?
be back on this soon once i do the check...
 
Old 01-28-2015, 03:36 AM   #37
nitecrawler
Member
 
Registered: Dec 2014
Distribution: slackware x86-64 14.2
Posts: 188

Original Poster
Rep: Reputation: Disabled
do i have to check anything more or just get started with the python script as suggested by @schneidz?

and one more thing how do i transfer a few songs that i listen to this ipod?cos i dont understand the fn folders named like F01, FO2 etc? do help me on the transfer part first...

shall i start a new thread for the same???
do i dig into the database file like suggested?
need it solved somehow...and no, not with virtual machine and windows on it or gtkpod but from cli..feel at ease and at home grounds only when its shady out there....

let me be frank....getting fn desperate about it too...do help me out...will be back soon....
 
Old 01-28-2015, 08:09 AM   #38
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
i dont own an ipod (one of the reasons why i bought a creative zen vision:w was because its easier to transfer videos via usb (that and the video ipod hadnt existed yet)).

and i chose android instead of ifone because usb transfers are easier. apple on linux is always going to be an uphill battle.

what are you trying to do ?
i would first identify the mechanism that apple uses to map filenames to song information (i assume there is some (encrypted?) file which contains that info).

to transfer files: are you able to successfully use the cp command to transfer files to any of those F01, FO2, ... directories. if so i think getting it to actually play on the device is contingent on updating the song information in the hypothetical song database file.
 
Old 01-28-2015, 08:10 AM   #39
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 932

Rep: Reputation: 522Reputation: 522Reputation: 522Reputation: 522Reputation: 522Reputation: 522
Quote:
Originally Posted by nitecrawler View Post
Code:
id3info /mnt/my_ipod/iTunes_Control/Music/F03/ELJQ.mp3
*** Tag information for ELJQ.mp3
=== TALB (Album/Movie/Show title): The Essential Judas Priest 
=== TPE1 (Lead performer(s)/Soloist(s)): Judas Priest
=== TPE2 (Band/orchestra/accompaniment): JUDAS PRIEST
=== COMM (Comments): ()[eng]: Tags edt. by herguim
=== TCON (Content type): Heavy Metal
=== TIT2 (Title/songname/content description): Breaking The Law
=== TRCK (Track number/Position in set): 02
=== TYER (Year): 2006
=== APIC (Attached picture): ()[, 0]: image/jpeg, 67134 bytes
=== COMM (Comments): (ID3v1 Comment)[XXX]: Tags edt. by herguim
*** mp3 info
MPEG1/layer III
Bitrate: 64KBps
Frequency: 48KHz
If you can retrieve the tag info, then this script could help.

I didn't test it extensively, so you would test it with some files and folders first.

The script relies on the tag information, so you must pay attention
in files with blank fields or generic fields like
"=== TALB (Album/Movie/Show title): "
or
"=== TPE1 (Lead performer(s)/Soloist(s)): "
or
"=== TALB (Album/Movie/Show title): Album"
or
"=== TPE1 (Lead performer(s)/Soloist(s)): Artist"


There's a character substitution to replace '/' for '-', and other annoying characters in Linux,
as well some forbidden characters in Windows.

Hope this helps
Code:
#!/bin/bash


if [ "$1" = '--apply' ]; then
read -p"
Files will be copied and renamed. Confirm (y/n)? "
[[ "$REPLY" =~ ^[yY] ]] || exit
else
read -p"
This is a '--dry-run'.
Check if it's all right and run '$0 --apply' to apply the changes.
The original files won't be deleted, just copied.
<any key to continue>
"
fi


source_dir="$HOME/Music" # Maybe /mnt/my_ipod/iTunes_Control/Music
target_dir="$HOME/Music"


forbidden_characters(){
 aux=$(sed -e "y/{}()<>\"/[][][]'/" -e 's/?//g; s/#//g' <<<"$2"|tr '\\/:*|' -)
 eval $1'=$aux'
}



big_list=$(find "$source_dir" -type f -name *.mp3)

while read line; do

	file=$(id3info "$line")

	track=$([[ $(grep TRCK <<<"$file") =~ :\ (.+) ]] && \
		echo ${BASH_REMATCH[1]})

	title=$([[ $(grep TIT2 <<<"$file") =~ :\ (.+) ]] && \
		echo ${BASH_REMATCH[1]})
	forbidden_characters title "$title"

	album=$([[ $(grep TALB <<<"$file") =~ :\ (.+) ]] && \
		echo ${BASH_REMATCH[1]})
	forbidden_characters album "$album"

	year=$([[ $(grep TYER <<<"$file") =~ :\ (.+) ]] && \
		echo ${BASH_REMATCH[1]})

	artist=$([[ $(grep TPE1 <<<"$file") =~ :\ (.+) ]] && \
		echo ${BASH_REMATCH[1]})
	forbidden_characters artist "$artist"

	if [ "$1" != '--apply' ]; then
		cat <<-EOF

		File
		$line
		will be copied to
		$target_dir/$artist/$year $album/$track. $title.mp3
		EOF
	else
		[ ! -d "$target_dir/$artist/$year $album" ] && {
			mkdir -p "$target_dir/$artist/$year $album";}
		cp -v --preserve=all \
		"$line" "$target_dir/$artist/$year $album/$track. $title.mp3"
	fi

done <<<"$big_list"
 
Old 01-28-2015, 08:34 AM   #40
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
^ according to their response #34 not all of their files have id3tag info embedded in them.

Last edited by schneidz; 01-28-2015 at 11:29 AM.
 
Old 01-28-2015, 11:02 AM   #41
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 932

Rep: Reputation: 522Reputation: 522Reputation: 522Reputation: 522Reputation: 522Reputation: 522
Quote:
Originally Posted by schneidz View Post
^ according to his response #34 not all of his files have id3tag info embedded in them.
Thanks for pointing this out, I didn't note.
Skipping those, nitecrawler can deal with those files later.

There are log files now, 'files-not-renamed' for files with missing tag fields,
'files-that-will-be-renamed_"$Date"' is a log for the '--dry-run'
and 'files-renamed_"$Date"' is a log with files actually renamed.

Code:
#!/bin/bash


if [ "$1" = '--apply' ]; then
read -p"
Files will be copied and renamed. Confirm (y/n)? "
[[ "$REPLY" =~ ^[yY] ]] || exit
else
read -p"
This is a '--dry-run'.
Check if it's all right and run '$0 --apply' to apply the changes.
The original files won't be deleted, just copied.
<any key to continue>
"
fi


source_dir="$HOME/Music" # Maybe /mnt/my_ipod/iTunes_Control/Music
target_dir="$HOME/Music"
Date=$(date +%F_%T|tr : -)

forbidden_characters(){
 aux=$(sed -e "y/{}()<>\"/[][][]'/" -e 's/?//g; s/#//g' <<<"$2"|tr '\\/:*|' -)
 eval $1'=$aux'
}



big_list=$(find "$source_dir" -type f -name *.mp3)

while read line; do

        file=$(id3info "$line")

        track=$([[ $(grep TRCK <<<"$file") =~ :\ (.+) ]] && \
                echo ${BASH_REMATCH[1]})

        title=$([[ $(grep TIT2 <<<"$file") =~ :\ (.+) ]] && \
                echo ${BASH_REMATCH[1]})

        album=$([[ $(grep TALB <<<"$file") =~ :\ (.+) ]] && \
                echo ${BASH_REMATCH[1]})

        year=$([[ $(grep TYER <<<"$file") =~ :\ (.+) ]] && \
                echo ${BASH_REMATCH[1]})

        artist=$([[ $(grep TPE1 <<<"$file") =~ :\ (.+) ]] && \
                echo ${BASH_REMATCH[1]})

        # Skip files whitout tag. Just one missing field is enough to skip.
        if [ ! "$track" -o ! "$title" -o ! "$album" -o ! "$year" -o ! "$artist" ]; then
                echo -e "\nMissing tag: $line"|tee -a files-not-renamed
                continue
        fi

        forbidden_characters title "$title"
        forbidden_characters album "$album"
        forbidden_characters artist "$artist"

        if [ "$1" != '--apply' ]; then
                cat <<-EOF|tee -a files-that-will-be-renamed_"$Date"

                File
                $line
                will be copied to
                $target_dir/$artist/$year $album/$track. $title.mp3
                EOF
        else
                [ ! -d "$target_dir/$artist/$year $album" ] && {
                        mkdir -p "$target_dir/$artist/$year $album";}
                echo | tee -a files-renamed_"$Date"
                cp -v --preserve=all \
                "$line" "$target_dir/$artist/$year $album/$track. $title.mp3"|
                        tee -a files-renamed_"$Date"
        fi

done <<<"$big_list"
I hope he has just a few files without tag
 
Old 01-29-2015, 09:12 AM   #42
nitecrawler
Member
 
Registered: Dec 2014
Distribution: slackware x86-64 14.2
Posts: 188

Original Poster
Rep: Reputation: Disabled
@paulo2: thanks for the script....
@schneidz: thats a good try alright to transfer files...

will get back,,,thanks
 
Old 03-12-2015, 05:49 AM   #43
nitecrawler
Member
 
Registered: Dec 2014
Distribution: slackware x86-64 14.2
Posts: 188

Original Poster
Rep: Reputation: Disabled
yes am late as usal...so here is my delayed response...

after months i get to sit back on my system with some time at hand....

i do a copy of the file and the file gets transferred to this F01 folder but nothing happens to my song listing in my ipod..
it doesnt get added there in the list....

specifically, the mv command copies my song to the ipod and when i do and ls i see it there...
now in the ipod if i check if the song is listed it isnt shown yet....


i would like to tell you the short folder structure....

/itunes_Control/iTunes

has files like iTunesDB but when i open it in nano its garbage values there...editor not able to read that file....stumped..


Edit plus: its the itunesDB file that needs to be edited..but i cant seem to read it as its gibberish...so guess the song should e playing if i get this part fixed....yeh and its one hell of a part to get through

Last edited by nitecrawler; 03-12-2015 at 06:24 AM. Reason: further reading
 
Old 03-12-2015, 06:47 AM   #44
nitecrawler
Member
 
Registered: Dec 2014
Distribution: slackware x86-64 14.2
Posts: 188

Original Poster
Rep: Reputation: Disabled
a quick reply;

i opened the file ie. itunesdb in vi editor and now i can see paragraphs as a grid and yes thats the file i need to edit to add songs...each grid is one song in the ipod.....but how could i possible understand this code?

Quote:
> offset 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
> 0002f200 18 00 00 00 4e 00 00 00 c8 00 00 00 00 00 00 00 ....N..........
> 0002f210 00 00 00 00 01 00 00 00 26 00 00 00 01 00 00 00 ........&.......
> 0002f220 00 00 00 00 55 00 73 00 65 00 20 00 59 00 6f 00 ....U.s.e. .Y.o.
> 0002f230 75 00 72 00 20 00 49 00 6c 00 6c 00 75 00 73 00 u.r. .I.l.l.u.s.
> 0002f240 69 00 6f 00 6e 00 20 00 49 00 6d 68 6f 64 18 00 i.o.n. .I.mhod..
> 0002f250 00 00 42 00 00 00 c9 00 00 00 00 00 00 00 00 00 ..B............
> 0002f260 00 00 01 00 00 00 1a 00 00 00 01 00 00 00 00 00 ................
> 0002f270 00 00 47 00 75 00 6e 00 73 00 20 00 4e 00 27 00 ..G.u.n.s. .N.'.
> 0002f280 20 00 52 00 6f 00 73 00 65 00 73 00 6d 68 6f 64 .R.o.s.e.s.mhod
> 0002f290 18 00 00 00 42 00 00 00 ca 00 00 00 00 00 00 00 ....B..........
> 0002f2a0 00 00 00 00 01 00 00 00 1a 00 00 00 01 00 00 00 ................
> 0002f2b0 00 00 00 00 47 00 75 00 6e 00 73 00 20 00 4e 00 ....G.u.n.s. .N.
> 0002f2c0 27 00 20 00 52 00 6f 00 73 00 65 00 73 00 6d 68 '. .R.o.s.e.s.mh
> 0002f2d0 69 61 58 00 00 00 86 01 00 00 03 00 00 00 11 04 iaX.............
> 0002f2e0 00 00 5e be ee da fc 76 3d 61 02 00 00 00 e2 15 ..^v=a.....
> 0002f2f0 82 25 75 24 ec 06 00 00 00 00 00 00 00 00 00 00 .u$...........


---------- Post added 03-12-15 at 05:18 PM ----------

you can identify the song or the so called id tag in the last column....i have grids like this for each song....
 
Old 03-12-2015, 07:15 AM   #45
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
You won't be able to edit that file in a normal text editor because it's a binary file, not a text file. I tried doing some quick searches on what format it is in, but came up empty. You might try using sqlite, but I have no idea if it will work.

Unfortunately, I think you're going to have a monumentally difficult time doing this by CLI, and I doubt it's documented anywhere short of looking at the source of programs that provide drag and drop. I think your best bet is to switch to a GUI program like gtkpod, banshee, or amarok, or sell that iPod Touch and get a player that does support UMS (USB Mass Storage), as that will be infinitely easier to use in Linux in the CLI.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I Just Mounted my iPod... But What Happened to My Music Filenames? hunterjoz1996 Linux - General 8 07-03-2014 09:03 AM
Support the Linux iPod Touch(Apple) movement. Goddard General 26 12-20-2009 02:36 AM
Linux OS for Apple Ipod Touch theunixwizard Linux - Laptop and Netbook 2 04-30-2008 08:45 PM
WTS apple ipod Touch jdphones1 Linux - Newbie 1 02-08-2008 07:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration