[WS] Discogs (pone mod)

findline "<div class=\"search_result"
do            
   # Cover    
   findline "lass=\"number\""    
   moveline 1

   if "<div class=\"thumb\""
      findline "class=\"search_release_stats\""
      findinline ">"
      # Year
      
      if "19"
         moveline -3
      else
         if "20"
            moveline -3
         endif
      endif
       
      if "<div class=\"thumb\""
         say "Cover"
         say "|"    
         findline "class=\"data\""

         joinuntil "</div>"
         killtag "em"
         killtag "/em"
         regexpreplace "\s{2,}" " "
    
         # URL
         findinline "<a href=\""
         sayuntil "\">"
         say "|"
    
         # Artist
         movechar 2
         sayuntil " - "
         say "|"
    
         # Album
         movechar 2
         sayuntil "</"
         say "|"
     
         findline "class=\"search_release_stats\""
         findinline ">"
    
         # Year
         saynextnumber
         say "|"
    
         # Format
         findinline "</span>"
         sayuntil "<"
         say "|"
           
         # Publisher
         findinline "</span>"
         sayuntil "<"
         say "|"
    
         # Catalog
         findinline "</span>" 1 1
         sayuntil "<"
         say "|"
    
         # Info
         killtag "em"
         killtag "/em"
         findinline "<div>"
         sayrest    
         saynewline
         exit

      endif
   endif

   findline "<div class=\"search_result" 1 1
   unspace
 
while "<div class=\"search_result" 250

nice, you solve everything you wanted.

I'm wondering if there is a script or tool to create a link to a different website.

I've seen the tools on the site but not sure how to get it to connect or pull data from another location.

The site is Artist Direct - www.artistdirect.com.

I've found it has the most uptodate info on old and new albums.

Current, I'm just doing a cut/paste into Mp3Tag for Credits and Performers info.

Is there a short cut script that I can use to get the data.

Thanks

Hey Pone,

I am using your script very excessive and I am very happy with it, since I did some tweaking for my needs.

I see that "Genre" is a multi value field. There is no prblem with that. But "Catalog #" & "Publisher" are not a Multi value field even if there are multiple values present.

It is alwas diplayed like this:

Publisher:
Eye Q Records\\\\WEA Musik GmbH
Catalog #:
4509 96216-2\\\\4509 96216-2

Yes I did save it an extra time and yes I looked under "Erweiterte Tags".

Is it possible to modife them also to multi value fields?

QUOTE (FreaQ @ Feb 14 2011, 10:43) <{POST_SNAPBACK}>
Hey Pone,

I am using your script very excessive and I am very happy with it, since I did some tweaking for my needs.

I see that "Genre" is a multi value field. There is no prblem with that. But "Catalog #" & "Publisher" are not a Multi value field even if there are multiple values present.

It is alwas diplayed like this:

Publisher:
Eye Q Records\\\\WEA Musik GmbH
Catalog #:
4509 96216-2\\\\4509 96216-2

Yes I did save it an extra time and yes I looked under "Erweiterte Tags".

Is it possible to modife them also to multi value fields?

That's strange. If they are displayed like this, they should be written as Multi Value Fields. On my system they are.
Is there any way you can write multi value fields in these tag fields in MP3tag without my script?

I can add "Publisher" and "Catalog #" as many times as I want.

And if I fill in String1\\String2 manually and save it, it will be written as multiple tags. Just from the script it is not working.
I will have a closer look.

Edit:
Ok. It also works for me.

I have to do an additional step.
"Publisher" and "Catalog #" will not be written in multiple fields just by CRTL-S.
I have to open "Erweiterte Tags" and hit OK. Nothing else.

For Genre it works with CRTL-S. This maybe because Genre is in the left mask.

This is a possible explanation.
I have added "Publisher" and "Catalog #" to the tag panel at the left, so I never experienced the difference.

To add fields to the tag panel:
Tools > Options > Tag-Panel > :mt_new: Add Field... >
Field: PUBLISHER / CATLOG #
Name: whatever you like

Maybe it's enough when you add it to the columns in the main file window:
View > Customize columns > New
Name: whatever you like
Value %publisher% / %catalog #%
leave "Field" and "Sort by" empty

Columns do not work. I have them there already.

But adding the fields to the Tag Panel was the solution. Now it works with CRTL-S

Hi Pone,

Discogs did some changes.

Released, Genre and Style are now links.

Therefore %YEAR% is not recognized anymore, but Genre and Style still are. <_<

will be fixed soon, thanks for reporting

Is there any way to add the rip/get the date from discogs to show up in the fields. The year is fine but some albums etc have the full date so is it possible to have from discogs info (see attached screen-shot)

mp3tag info:
Year: 2008
date: 0102

Thanks


I'm not planning to do this for this script for the sake of consitant year formats . But it is possible for sure.
If I have some time I'll make you a guide.

Scripts are updated (2.6) and working again.

Changed: The "direct by URL" search script can now also handle URLs which start with www. instead of http://www. if found in the %www% tag field (not as manual input)

Changed: In the search part %album% has got some more repalcements of words like CD, Vinyl, Web, Cd1, ... which spoil the search matches at discogs. If you need to search for a release which has one of these words at the end (like "Save the Vinyl", "First CD", "Caught in the Web") you must write i now manually in the search box.

Fixed/Changed: Albumartist "Various" was not changed into "va" in the last version. Now it is "va" again.

Fixed: %year% was not writen after changes at discogs. fixed

Fixed: There were additional spaced between the genres after changes at discogs. fixed

Fixed: Under certain rare cirucumstances quotationmarks in the title lead to html code in the title tag field. fixed

I droped the version which uses BAND instead of ALBUMARTIST for the old versions of Mp3Tag?
Is there still need for this?

I had a similiar request to Dano. He put it in his script.
But it is given the full date. eg: 2011-03-02 (YYYY-MM-DD)

I added a line for releases where only Year and Month is given, which outputs to 2011.03.00

Maybe it suits you, maybe pone will add is in his script.

This has to be right AFTER the year section in the script

# Full date
outputto "Date"
unspace
regexpreplace "<[^>]+>" "" #kt
replace "Jan" "-01-"
replace "Feb" "-02-"
replace "Mar" "-03-"
replace "Apr" "-04-"
replace "May" "-05-"
replace "Jun" "-06-"
replace "Jul" "-07-"
replace "Aug" "-08-"
replace "Sep" "-09-"
replace "Oct" "-10-"
replace "Nov" "-11-"
replace "Dec" "-12-"
regexpreplace "[^-0-9]" ""
regexpreplace "(\d\d)-(\d\d)-(\d\d\d\d)" "$3-$2-$1"
regexpreplace "-(\d\d)-(\d\d\d\d)" "$2-$1-00"
sayrest

BTW: Thanks for the new version of your script.

Put the code after year as described, but it was coming out with:
Year: 2005
Date: 2005-01-20

# Year
outputto ""
findline "class=\"head\">Released:"
moveline 3 1
findinline "&year=" 1 1
sayuntil "\""

# Full year
outputto "Year"
unspace
regexpreplace "<[^>]+>" "" #kt
replace "Jan" "-01-"
replace "Feb" "-02-"
replace "Mar" "-03-"
replace "Apr" "-04-"
replace "May" "-05-"
replace "Jun" "-06-"
replace "Jul" "-07-"
replace "Aug" "-08-"
replace "Sep" "-09-"
replace "Oct" "-10-"
replace "Nov" "-11-"
replace "Dec" "-12-"
regexpreplace "[^-0-9]" ""
regexpreplace "(\d\d)-(\d\d)-(\d\d\d\d)" "$3-$2-$1"
regexpreplace "-(\d\d)-(\d\d\d\d)" "$2-$1-00"
sayrest

Solved the problem by changing:

Year

outputto "Year"
TO

# Year

outputto ""

Full date

outputto "date"
TO

# Full year

outputto "Year"

Now it simply comes out with:
Year: 2005-01-20 (Just the way I want it)

Have never scripted before so it was hit and miss but it seemed to work. :stuck_out_tongue:

I thought that was your goal to have the two sperated.

But:

If it now suuits you even better.

UPDATE (v2.7):

I spent a lot of time to get some of the more complex tracklistings at discogs with the script. Here is the result of the last days work.

New: A new tag field called CHAPTER. The chapters or disc names found as headlines above or between the tracklist at discogs.
Look at this pages for examples:
http://www.discogs.com/Joy-Division--Singl...release/2586049
http://www.discogs.com/Kraftwerk-Der-Katalog/release/1996371
http://www.discogs.com/Erykah-Badu-Mamas-G.../release/424341

New: A extra script called "tracklist for albums with multi song tracks". It's for albums which combine more (but not all) songs in one track/file. Run it AFTER you tagged the album with one of the other scripts.
It rewrites the tags Albumartist, Chapter, Discnumber, Track, Track Temp, Artist, Title, Mixartist. The different songs are seperated by "/" within a track.

At the moment, it groups songs with the following tracknumber patterns (track 3 is the grouped track):
1, 2, 3a, 3b (example: http://www.discogs.com/Robag-Wruhme-Wuppde...release/2614288 )
1, 2, 3A, 3B
1, 2, 3.a, 3.b (example: http://www.discogs.com/Tayo-FabricLive-32/release/899274 )
text 1, text 2, text 3a, text3b (example: http://www.discogs.com/Richie-Hawtin-DE9-T.../release/554040 (but chapter recognition does not work here) )
1-01, 1-02, 1-03.1, 1-03.2 (example: http://www.discogs.com/Joris-Voorn-Balance...release/1639822 )
01, 02, 03.1, 03.2 (example: http://www.discogs.com/Richie-Hawtin-DE9-T.../release/555017 )

If chapters have a own track-positions, neither chapter recognition nor tracklist correction is working correct.
Basically these are wrong formated discogs pages. They use Track Position instead of Track Index for the disc titles/chapters.
examples:
http://www.discogs.com/Richie-Hawtin-DE9-T.../release/697759
http://www.discogs.com/Various-The-Kings-O.../release/814835

as always: feel free to write comments and suggestions!

  • see starting post for download -

I made a Mp3Tag action group which generates a .cue file for dj mixes (or other compilations) in one file.
It's a modification of a scirpt I made for general tracklists.
Optimized now for use in combination with my discogs scripts. Works pretty fine!

Instalation:

  1. Download the zip file & extract the folder structure to %appdata%\mp3tag

Usage:

  1. Run any of my discogs-scripts to do the basic tagging of the audio file.
  2. Run my "tracklist for DJ Sets in one file" script, to get the tracklist into the file.
  3. Run the actiongroup, to generate a .cue file.
  4. Delete the tracklist-section in the UNSYNCEDLYRICS field manually to avoid double storage of the tracklist data.
    Or, alternatively, click Edit > Undo (Ctrl+Z) to restore the tracklist as it was before the action in the UNSYNCEDLYRICS field. The cuefile does not get deleted by this undo process.

Comments:

  1. If the tracklist from discogs has not tracklengths, no cuefile can be generated.
  2. For double CDs, you have to delete the parts of the tracklist which don't belong to the file manually after step two.
  3. I recommend having the UNSYNCEDLYRICS field in the tag panel, as my script is not fully automatic (usage step four, comments one & two).

I have only tested a few pages so far. Works fine on most releases. Even most of the more complicated tracklists (see posting above) work.
Mixarists (Producer,Remixer,...) can not be written into the cue file as far as I know. So you have a slight loss of information, when you transfer the tracklist form the UNSYNCEDLYRICS tag field into the .cue file and delete the tracklist in the tag field afterwards. Just wanted to point on that. If anybody knows how to implement a field like MIXARTIST into a cue file, please let me know.

The actiongroup will be packed into the next update of the script.
Improvement suggestions and reports of discogs pages which don't work are welcome!

Download:

Cue_Sheet__Discogs_Pone.zip (1.57 KB)

At first thanks a lot for your mod plone! I just registered here just because of your script.
I've one question: Which tag are you using for Mediatype? When I click on
Extras -> Options ->Tag-Panel -> Add -> MEDIATYPE
the discogs-tag like "Vinyl, 12'' EP" does not show up. I've used this field recently for storing this information. Aren't you using the mediatype-field mp3tag uses?

Another question: Can you tell me how to edit your script, to only store one of the following in MEDIATYPE:
Vinyl (i.e. Vinyl, 12", 45 RPM)
WEB (i.e. 2 x File, MP3, 320 kbps)
CD (i.e. CD, Compilation, Mixed)

And one last thing:
I would like to store the original year in this format yyyy-mm or yyyy if there is no month stored.

And once again, big thanks for your script! Now I'm one step closer to an ordered mp3 collection :slight_smile:

greetings TLO

I use DISCOGS_MEDIATYPE instead of MEDIATYPE because in many cases, the mediatype at discogs is not the same as my mp3s are from, e.g., discogs has often only the vinyl release listed when I have a web release mp3.
(See starting post for detailed listing of the tag fields the script is writing. Or open the exptended tag view in Mp3tag after you used my script: Alt+T :mt_tag: )

Information like Vinyl, WEB, CD is more commonly stored in the SOURCE tag-field. But there is no clear difference to be between MEDIATYPE and SOURCE. Maybe MEDIATYPE should be used to store information like Album/Single/Best-of/Compilation/Live Recording.
Discogs's Mediatype combines both, so I left it as it is.

Open the script with a text editor and search the following part:

change it like the following:

The changes are marked in bold type. outputto "Mediatype" changes the tag-field to MEDIATYPE as you want it. The regexpreplace replace the mediatype form discogs with the word in the second quotationmarks with if one of the word in the first quotationmarks is found. You can expand that list and make alternatives as shown with Vinyl.
For a list of the used formats at discogs, look here http://www.discogs.com/explore > Formats > Show More

If you edit the script, you have to edit all versions of it. I recommend the freeware text editor notpad++ There you can edit one script and paste the changes into the others automatically. But it's tricky with multiline replacements.

See the discussion of FreaQ and stevehero above how to do this. Or look at dano's discogs scipt to see how he is doing it: /t/1992/1

I have not included this in the script, because
a) i don't know if how different mediaplayers display different formats at YEAR
b ) the information is not always there at discogs
c) release pages is about different releases of the same album (master release page). these different releases often do not have the same release date. this is also true for the year itself, but you see the different years in the discogs-search-page/mp3tag-websource-index-window. With the month it gets to complex and unclear. You would have to check every release page to see the different dates if you want to get sure you have the first release date.
d) as it is this complex, I think the release dates at discogs are not always correct, discogs users see the release date in their country and just asume it to be the global release date. And also the other way around.