|
|||||||
| Register | Blogging | Search | Today's Posts | Mark Forums Read |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 (permalink) |
|
thirsty ears
Join Date: Sep 2009
Location: Boulder
Posts: 742
|
ipod flashing is very safe. all the original firmware remains intact you can boot into it at any time. as far as i understand, the only thing actually flashed is a sort of boot loader that directs things towards the custom firmware. and of course it's all completely reversible
__________________
my flac collection |
|
|
|
|
|
#2 (permalink) |
|
thirsty ears
Join Date: Sep 2009
Location: Boulder
Posts: 742
|
tore, are you willing to share that script? it sounds incredibly useful!
at one point i tried using various plugins to grab genre/style info from AllMusic, but never got very good results... i'm not sure how much i would like using someone else's categorizations, but i can always back up tags and restore them if things don't work out
__________________
my flac collection |
|
|
|
|
|
#3 (permalink) | |
|
Juicious Maximus III
Join Date: Nov 2008
Location: Scabb Island
Posts: 6,525
|
Quote:
It's a bit of a workaround - it's actually based on a plugin which allows custom python scripts to fetch lyrics .. But since they are custom scripts, it's not hard to rewrite them so that they fetch other things. My own script is a merge of two other scripts, one to fetch discogs genres and one to fetch styles .. First, I just put those two together. Then there was a problem with queries, you're only allowed to access discogs 5000 times per 24 hours that way, so you could only tag 5000 files. I came up with a workaround for that problem by using text files as temporary storage for information. Basically, when the script starts working on a file, it writes that song's album title into a text file and fetches discogs info. When it moves on to the next file, it compares the album title to the information written to the text file by the previous song. If it's the same, it just tags it with the same info. If the album is different, it fetches new info and rewrites the text files. It also uses a text file for temporary storage of the information that goes into the genre and style tags, but that's the jist of it. Instead of tagging 5000 songs, you can tag 5000 albums ..It doesn't work for all files, but at least for more than 3/4ths of my own collection. Aside from artists and albums having wrong titles, a possible problem is when there are more bands with the same name. Discogs register them as Band (1), Band (2) and so on (f.ex Arsenal (1), Arsenal (2) etc.) and since we don't normally have numbers in parantheses after band names, those may not get tagged. Anyways, to make it work, there are a few things you're gonna need: And these two, both found at the same location : The latter of those two contains some files and folders (ex. python25.dll) that all need to be located in your base foobar folder. The files and folders should look something like this : Code:
C:\Program Files\foobar2000>dir p*.dll /s/b & dir *grab* /s/b & dir pygrabber\* /s/b & ver C:\Program Files\foobar2000\python25.dll C:\Program Files\foobar2000\lyrics_grabber_provider.cfg C:\Program Files\foobar2000\pygrabber C:\Program Files\foobar2000\components\foo_grabber_python.dll C:\Program Files\foobar2000\components\foo_lyricsgrabber.dll C:\Program Files\foobar2000\pygrabber\libs C:\Program Files\foobar2000\pygrabber\newscripts C:\Program Files\foobar2000\pygrabber\scripts C:\Program Files\foobar2000\pygrabber\system C:\Program Files\foobar2000\pygrabber\newscripts\newscripts.rar C:\Program Files\foobar2000\pygrabber\scripts\AZLyrics.py C:\Program Files\foobar2000\pygrabber\scripts\DarkLyrics.py C:\Program Files\foobar2000\pygrabber\scripts\Discogs_GetGenre.py C:\Program Files\foobar2000\pygrabber\scripts\Discogs_GetStyle.py C:\Program Files\foobar2000\pygrabber\scripts\LastFm_Bio.py C:\Program Files\foobar2000\pygrabber\scripts\LastFm_TopTag.py C:\Program Files\foobar2000\pygrabber\scripts\LastFm_TrackTags.py C:\Program Files\foobar2000\pygrabber\scripts\LeosLyrics.py C:\Program Files\foobar2000\pygrabber\scripts\LyrDB.py C:\Program Files\foobar2000\pygrabber\scripts\Lyricist(LRC).py C:\Program Files\foobar2000\pygrabber\scripts\TTPlayer(LRC).py C:\Program Files\foobar2000\pygrabber\system\autoexec.py C:\Program Files\foobar2000\pygrabber\system\BeautifulSoup.py C:\Program Files\foobar2000\pygrabber\system\BeautifulSoup.pyc C:\Program Files\foobar2000\pygrabber\system\Html2Text.py C:\Program Files\foobar2000\pygrabber\system\Html2Text.pyc C:\Program Files\foobar2000\pygrabber\system\LevenshteinDistance.py C:\Program Files\foobar2000\pygrabber\system\LevenshteinDistance.pyc C:\Program Files\foobar2000\pygrabber\system\Lucky.py C:\Program Files\foobar2000\pygrabber\system\Lucky.pyc C:\Program Files\foobar2000\pygrabber\system\pyexpat.pyd C:\Program Files\foobar2000\pygrabber\system\Python25.zip C:\Program Files\foobar2000\pygrabber\system\unicodedata.pyd C:\Program Files\foobar2000\pygrabber\system\_socket.pyd ![]() Your foobar folder will now contain a folder called "/pygrabber/scripts". This is where you should put the script I've written. The simplest way to do it I guess is just paste the script here for you to copy and paste. Then I can show you the changes you should make. So, copy the following script and save it in a text file in the scripts folder. Rename it to something like "tores_discogs_script.py" and then you may want to edit it and have a closer look at the red parts : Code:
import urllib, urllib2, gzip, cStringIO
import xml.etree.ElementTree
from xml.dom import minidom
from encodings import utf_8
from grabber import LyricProviderBase
class Discogs_GetGenre(LyricProviderBase):
def GetName(self):
return 'Discogs GenStyles'
def GetVersion(self):
return '0.1'
def GetURL(self):
return 'http://www.discogs.com'
def Query(self, handles, status, abort):
result = []
api_key = '783001745d'
for handle in handles:
status.Advance()
if abort.Aborting():
return result
artist = handle.Format("[%artist%]")
album = handle.Format("[%album%]")
album_file = open("C:\Python26\!album.txt", "r")
test = album_file.read()
album_file.close()
try:
if album == test:
text_file = open("C:\Python26\!tag3.txt", "r")
writeout = text_file.read()
text_file.close()
result.append(writeout)
else:
URL_s = 'http://www.discogs.com/search?type=all&q=' + artist.lower().replace(' ','+') + '+' + album.lower().replace(' ','+') + '&f=xml&api_key=' + api_key
request = urllib2.Request(URL_s)
request.add_header('Accept-Encoding', 'gzip')
response = urllib2.urlopen(request)
data = response.read()
unzipped_data = gzip.GzipFile(fileobj = cStringIO.StringIO(data)).read()
res = minidom.parseString(unzipped_data)
uri_1 = res.getElementsByTagName("uri")[0]
rel_id = uri_1.childNodes[0].data.encode('utf-8').rpartition('/')[2]
URL_r = 'http://www.discogs.com/release/' + rel_id + '?f=xml&api_key=' + api_key
request = urllib2.Request(URL_r)
request.add_header('Accept-Encoding', 'gzip')
response = urllib2.urlopen(request)
data = response.read()
unzipped_data = gzip.GzipFile(fileobj = cStringIO.StringIO(data)).read()
xml.etree.ElementTree.fromstring(unzipped_data)
def getGenres(tree):
genres = []
release = tree.find('release')
genreList = release.find('genres')
if genreList:
for i in genreList:
genres.append(i.text)
return genres
def getStyles(tree):
styles = []
release = tree.find('release')
styleList = release.find('styles')
if styleList:
for i in styleList:
styles.append(i.text)
return styles
lyric=getGenres(xml.etree.ElementTree.fromstring(unzipped_data))
lyric.append('//')
lyric.append(getStyles(xml.etree.ElementTree.fromstring(unzipped_data)))
lyric=str(lyric).strip('[').strip(']').replace(',', ';').replace('\'','').replace('[','').replace('Folk; World; & Country','Folk, World, & Country')
result.append(lyric)
album_file = open("C:\Python26\!album.txt", "w")
album_file.write(album)
album_file.close()
text_file = open("C:\Python26\!tag3.txt", "w")
text_file.write(lyric)
text_file.close()
except Exception, e:
traceback.print_exc(file=sys.stdout)
result.append('')
album_file = open("C:\Python26\!album.txt", "w")
album_file.write(album)
album_file.close()
text_file = open("C:\Python26\!tag3.txt", "w")
text_file.write('')
text_file.close()
continue
return result
if __name__ == "__main__":
LyricProviderInstance = Discogs_GetGenre()
__________________
Something Completely Different |
|
|
|
|
|
|
#4 (permalink) |
|
thirsty ears
Join Date: Sep 2009
Location: Boulder
Posts: 742
|
awesome! i'll definitely play with this over the weekend. i like your text file workaround, it will let me run through my whole collection in one go. i expect i'll have to do a lot manually, and i have quite a few releases that are not even listed on discogs, but such is life
![]() many thanks for taking the time to put together those instructions, i really appreciate it
__________________
my flac collection |
|
|
|
|
|
#5 (permalink) | |
|
Juicious Maximus III
Join Date: Nov 2008
Location: Scabb Island
Posts: 6,525
|
<- continued from last post
The red bits you might wanna change are the folders and filenames of the text files for temporary storage. You may wanna keep these text files out of the program files folders - at least Win 7 doesn't give my script the rights to create or write to text files in there. You may also wanna create the text files before you run the script. As I'm not actually a python programmer, I'm unsure if the script will create them, but it uses them if they at all exist. After that, you need to start up foobar. Right click any file and go to "Legacy commands (unsorted) -> Configuration". There's an option for provider. Choose Python and then "option -> setting". A new screen opens. Click refresh in the bottom left, then OK to close it. In the configuration screen, also write the name of the tag the information should be written to, f.ex "genstyles". Now, all you have to do is mark the albums you wanna tag, then right click and choose : "Legacy commands (unsorted) -> Python -> Discogs Genstyles". All the information will be written to the tag you specified like this : "Genre; //; Style" To split them into genre and styles tags, right click the selection, choose properties. In the bottom left corner, click tools and choose "automatically fill values". In the new window, change "source" to "other" and then write %genstyles% or whatever tag you used to save the information to .. Then in the pattern field, you write : %genre%; //; %style% And press okay. That's it! EDIT : Included a picture as well! ![]() The reason this ain't all beautiful is because when I started fiddling with this, I'd never looked at a python script before and I didn't make this with the intention of publishing it anywhere, but it should work. If it doesn't, just ask and I'm sure I can help. edit : Quote:
__________________
Something Completely Different |
|
|
|
|
|
|
#6 (permalink) |
|
thirsty ears
Join Date: Sep 2009
Location: Boulder
Posts: 742
|
oops sorry, didn't mean to interrupt your post
![]() i've used that script plugin before so it won't be tough to sort out. thanks again. looking forward to this!
__________________
my flac collection |
|
|
|
|
|
#7 (permalink) | |
|
Juicious Maximus III
Join Date: Nov 2008
Location: Scabb Island
Posts: 6,525
|
Quote:
__________________
Something Completely Different |
|
|
|
|
|
|
#8 (permalink) |
|
Dazed and confuzzled
Join Date: Jul 2008
Location: England
Posts: 1,552
|
Don't worry about putting allsorts on your iPod, in the past I've had linux working on it, wikipedia, rockbox, etc. It can all be changed or removed if you change your mind and Apple wouldn't know.
__________________
I have acquired four score and nineteen difficulties, but a wench cannot be counted among them |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|