Genre Import Only


#1

I've got a problem - I have tagged all 250gb of my music, but forgot about importing genres.

Could someone please make a source for genre tags only? I tried it myself, but for some reason, it pulls up a blank window after downloading the information! :-\

I prefer Discogs.com - but if someone has another BETTER source for Genre categorization, definitely post!

Thanks very much! :smiley:


#2

get one of the discogs scripts and comment out (with '#') the lines that get other information. maybe you want to keep genre AND style because they are both used at discogs.


#3

Thanks for the advice! :smiley:

I tried #ing out everything I didn't want. But unfortunately - it didn't work. I wasn't sure what to keep at the end of the script.

Also, it pulls up the artist's albums fine - but when pulling up information for a single album, it displays a blank window.

Also - instead of the album window displaying track information (when it works again) - would it be possible for it to display genre and style information?

Any help is greatly appreciated! Thanks for taking the time to help me on this! :slight_smile:

BTW, here's a copy of what I have so far...

# ###################################################################
# Mp3tag (v2.33+) parsing for discogs.com
#
# Search by ARTIST
# This file should be in your sources directory
# On Windows XP it's 
# C:\Documents and Settings\*username*\Application Data\Mp3tag\data\sources
# 
# Modifications:
#   2005-11-22: updated
#	2006-05-23: updated
#
# ###################################################################

[Name]=Discogs
[BasedOn]=http://www.discogs.com
[IndexUrl]=http://www.discogs.com/artist/
[AlbumUrl]=http://www.discogs.com
[WordSeperator]=+
[IndexFormat]=%_url%|%Album%|%Type%|%Label%|%Year%
[SearchBy]=%artist%

[ParserScriptIndex]=...
# ###################################################################
# This script parses the artist's page for all releases
# by this artist.
#
# The output format is defined by IndexFormat above, which
# is used by the selection dialog
# ###################################################################

# Uncomment the following line if you want to write some debug output
#debug "on" "c:\\\\debug_discogs_A.html" "10"

findline "Releases:"

do
	findline "<a href=\""
	findinline "<a href=\""
	sayuntil "\""
	say "|"
	
	# Album
	findinline ">"
	sayuntil "<"
	say "|"
	
	# Type
	findinline "("
	sayuntil ")"
	say "|"
	
	# Label
	moveline 2	
	joinuntil "</td>"
	findinline ">" 2
	sayuntil "<"
	say "|"
	
	moveline 1
	findinline "<td>"
	saynextnumber
	
	saynewline
	moveline 12
	
while "	<a href=" 500

[ParserScriptAlbum]=...
# ###################################################################
# This script parses the albums page for all common information.
#
# The current output variable is set via the outputto command
# All these fields are used by the confirm online information dialog
# ###################################################################

# Uncomment the following line if you want to write some debug output
#debug "on" "c:\\\\debug_discogsB.html"

findline "<title>"
findinline "<title>"

	# Artist
	#outputto "Artist"
	#joinuntil "</title>"
	#regexpreplace "\s{2,}" " "
	#findinline "<title>"
	#sayuntil " - "

	# Album
	#outputto "Album"
	#findline "- "
	#findinline "- "
	#sayuntil "<" 

	# Cover url
	#outputto "coverurl"
	#findline "<td valign=top"
	#findinline "<td valign=top"
	#if " align=center>"
	#	findinline "<img src=\""
	#	sayuntil "-150-"
	#	movechar 4
	#	sayuntil "\""  
	#endif

	# Year
	#outputto "Year"
	#findline "Released:"
	#findinline "<td>"
	# This trick makes sure, that we get the year for both "27 Feb 2004" 
	# and "2004" formats
	#findinline "<"
	#movechar -5
	#sayuntil "<"

	# Genre (only 1)
	outputto "Genre"
	findline "Genre:"
	joinuntil "</tr>"
	killtag "*"
	regexpreplace "\s+" " "
	regexpreplace "\s+$" ""
	regexpreplace ",\s\w+$" ""
	findinline "Genre:"
	sayrest

	# Style (all)
	outputto "Style"
	findline "Style:"
	joinuntil "</tr>"
	killtag "*"
	regexpreplace "\s+" " "
	findinline "Style:"
	sayrest

	# Tracks
	#outputto "tracks"
	#findline "Tracklisting:"
	#findline " nowrap"
	#do 
	#	moveline 6
		# Title
	#	unspace
	#	if "<td></td>" # emtpy table row!
	#		exit
	#   else
	#   	killtag "*"
	#		regexpreplace "\s\(\d?\d:\d\d\)" ""
	#		sayuntil "</td>"
		#	say "|"
		#	findline " nowrap" 1 1
		#	unspace
		endif
	while "<td "

#4

ok try this:

 [Name]=Discogs
[BasedOn]=http://www.discogs.com
[IndexUrl]=http://www.discogs.com/artist/
[AlbumUrl]=http://www.discogs.com
[WordSeperator]=+
[IndexFormat]=%_url%|%Album%|%Type%|%Label%|%Year%
[SearchBy]=%artist%

[ParserScriptIndex]=...
# ###################################################################
# This script parses the artist's page for all releases
# by this artist.
#
# The output format is defined by IndexFormat above, which
# is used by the selection dialog
# ###################################################################

# Uncomment the following line if you want to write some debug output
# debug "on" "c:\A.txt" "10"

findline "Releases:"

do
    findline "<a href=\""
    findinline "<a href=\""
    sayuntil "\""
    say "|"
    
    # Album
    findinline ">"
    sayuntil "<"
    say "|"
    
    # Type
    findinline "("
    sayuntil ")"
    say "|"
    
    # Label
    moveline 2    
    joinuntil "</td>"
    findinline ">" 2
    sayuntil "<"
    say "|"
    
    moveline 1
    findinline "<td>"
    saynextnumber
    
    saynewline
    moveline 12
    
while "    <a href=" 500

#[ParserScriptIndex]=...
# ###################################################################
#                    I  N  D  E  X
# ###################################################################

#debug "on" "C:\C.txt"

#sayoutput "CurrentUrl"
#say "|"
#say " |"
#say " |"
#say " |"
#saynewline

[ParserScriptAlbum]=...
# ###################################################################
#                    A  L  B  U  M
# ###################################################################
#debug "on" "C:\E.txt" 

findline "Tracklisting:"
findline "<td nowrap"
findline "<td" 2
findinline "<td"

if " "
    #################################################################  
    # VA-mode


    

    gotoline 2

    # Genre 
    outputto "genre"
    findline "Genre:"
    joinuntil "</tr>"
    killtag "*"
    regexpreplace "\s+" " "
    regexpreplace "\s+$" ""
    regexpreplace ",\s[ \w/]+$" ""
    findinline "Genre:"
    sayrest

    # Styles
    outputto "Style"
    findline "Style:"
    joinuntil "</tr>"
    killtag "*"
    regexpreplace "\s+" " "
    findinline "Style:"
    sayrest


    # End of VA
    # ###############################################################

else

    gotoline 2

    # Genre 
    outputto "genre"
    findline "Genre:"
    joinuntil "</tr>"
    killtag "*"
    regexpreplace "\s+" " "
    regexpreplace "\s+$" ""
    regexpreplace ",\s\w+$" ""
    findinline "Genre:"
    sayrest

    # Styles (all)
    outputto "styles"
    findline "Style:"
    joinuntil "</tr>"
    killtag "*"
    regexpreplace "\s+" " "
    findinline "Style:"
    sayrest

endif

...lots of redundant lines, but i think it works :]


#5

Amazing! Thank you very much! This saved me ALOT of work! :smiley: