Jump to content

cap

Active Members
  • Posts

    13
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

cap's Achievements

Newbie

Newbie (1/14)

  1. This post at tweakguides explains that Firefox stores its cache in C:Documents and SettingsUSERNAMEApplication DataMozillaFirefoxProfiles but Firefox stores everything into containers so you won't see the files you downloaded. You can browse them if you type the URL about:cache or you use a CacheViewer
  2. Yeah, the artist and song name does not appear in the browser title bar anymore. I think that's where PJ was taking it from.
  3. I cannot comment on beta 4 since I don't have it. We can use the grave accent to replace the apostrophe, but PJ never got a chance to see the song name with the apostrophe, so that would not help. Some day, we will need to fix the bug with artist names that contain an ampersand. This character is the parameter separator in a URL query string. The net effect is to truncact the artist or song name at the ampersand.
  4. For the timestamp, take a look at the call sortFilesByLastModified(joinedMp3s); in getJoinedPandoraMp3FilesInDecendingOrder() Is this what you are thinking of? Checking if the file is not changing size is a good idea. Today I saw one reason why you might have problems. Pandora (not PJ) has a bug where the Firefox title bar is not updated with the current song name. For me, this occured when the song contained an apostrophe. PJ has no way of knowing if the title bar is correct. It just copies the newest mp3 with the name found in the title bar. It would be difficult to fix that. Maybe the best we could do is to copy the song name next to the grab button to make it clearer which name will be used.
  5. Why not fix grabMP3()? What would you do differently in your implementation? All the problems I heard about were caused by cluttered TEMP directories or grabbing before the song has finished downloading.
  6. I did not have to reverse engineer the code, it's open source. What you are trying to do with PHP that PJ is not already doing?
  7. You need to turn on CDDB lookup to find the album name and track number, you need to turn on last.fm data lookup to find the cover art (you don't need a last.fm username/password) I posted a source code patch here on Friday to fix the CDDB lookup. cover art lookup is broken because last.fm has changed its HTML page. The fix should be simple once I have a couple hours to work on it.
  8. The cover art does not work because PJ is looking for the string "Track Statistics" but this string no longer appears in the lastfm HTML page. private static int setTrackStats(String text, LastFmTrackStats lastFmTrackStats) { int startTracjInfo = text.indexOf("Track Statistics"); if (startTracjInfo == -1) { throw new RuntimeException("Song info not found"); } The call to setAlbumImageLocation() appears after the call to setTrackStats() but it is by-passed by the exception as it unrolls the stack. Does anyone remember what the track stats looked like in PJ when it was still working? If I cannot figure out what the song stats are supposed to do, I might simply comment out the code and let the cover art code run through.
  9. If it does not work, you can remove the patch by restoring your pandora.jar from your backup copy pandora.jar.bak pandora.jar I might work on a batch processor to update my ID3 tags. I might also look at fetching the album art since that does not work for me now.
  10. Let's try this. You need the Java JDK and not the JRE. Stop PandoraJar so we can write over pandora.jar cd <pandora jar home> copy pandora.jar pandora.jar.bak mkdir util Copy the source of CddbLookUp above to a file <pandora jar home>utilCddbLookUp.java Watch out for capital letters, the case is important. Compile the source with javac, all on one line. There is a space before util/ javac -classpath pandora.jar;lib/JID3.jar;lib/commons-logging-1.0.4.jar;lib/httpunit.jar util/CddbLookUp.java Update the jar file with the new class file. jar -uf pandora.jar util/CddbLookUp.class You only need to do this once. Now start PandoraJar as usual If you know how to run ant to build the whole jar, you don't need those instructions anyways.
  11. You need to compile the source and rebuild the jar. Thank you for your offer to host pandora.jar. That will be useful. My pandora.jar is a patched version of 7.2, we should patch a newer version of the jar instead. If you tell me where to get the newer jars, I can patch them for you. I tried wildandbad.com and the site is down again. The source of CddbLookUp.java did not change between 7.2 and 7.3. I don't know if it changed between 7.3 and 7.3.x. Is there a 7.4 out there? Is there a subversion or CVS repository for PandoraJar somewhere? How can we get code changes accepted in the official distribution?
  12. The Forum FAQ says I can't upload images so I assume I can't upload source files or jars either. All the changes are in CddbLookUp.java, so here it is: package util; import com.meterware.httpunit.*; import org.xml.sax.SAXException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import java.io.IOException; import java.util.StringTokenizer; import java.net.URLEncoder; public class CddbLookUp { private static Log LOG = LogFactory.getLog(CddbLookUp.class); public static void lookup(SongInfo songInfo) throws IOException, SAXException, IdaNotFoundException { LOG.info("looking up data: " + songInfo); String artist = songInfo.getArtist(); String title = songInfo.getTitle(); if (artist == null || title == null) { throw new RuntimeException("unable to fetch ID3 info - title and artist are required"); } int featuring = title.indexOf("(feat."); if (featuring != -1) title = title.substring(0, featuring).trim(); WebConversation wc = new WebConversation(); WebRequest req = new GetMethodWebRequest("http://www.gracenote.com/music/index_old.html"); WebResponse resp = wc.getResponse(req); WebForm searchForm = resp.getFormWithName("search"); searchForm.setParameter("qartist", URLEncoder.encode(artist, "UTF-8")); searchForm.setParameter("qtrack", URLEncoder.encode(title, "UTF-8")); WebResponse webResponse = searchForm.submit(); LOG.debug("submitted initial search"); if (webResponse.getTitle().toUpperCase().indexOf("SEARCH") != -1) { HTMLElement[] mainAreas = webResponse.getElementsWithAttribute("class", "cddb_main_area"); HTMLSegment segment = mainAreas.length &gt; 0 ? (HTMLSegment)mainAreas[0] : webResponse; WebLink[] links = segment.getLinks(); boolean found = false; LOG.debug("looking for artist: " + artist); for (WebLink link : links) { String text = link.getText(); LOG.debug("line: " + text); if (text.toUpperCase().indexOf(artist.toUpperCase()) != -1) { webResponse = link.click(); found = true; break; } } if (!found) { throw new IdaNotFoundException("no IDA tag found for artist: " + songInfo); } LOG.debug("clicked through"); } else { LOG.debug("skipped clicked through"); } HTMLElement[] albumTd = webResponse.getElementsWithAttribute("class", "cddb_returns"); String[] strings = albumTd[0].getText().split("n"); for (String text : strings) { LOG.debug("ele: " + text); if ((text.toUpperCase().indexOf(artist.toUpperCase()) != -1) &amp;&amp; songInfo.getAlbum() == null) { String album = text.substring(text.indexOf("/") + 1).trim(); LOG.debug("setting album: " + album); songInfo.setAlbum(album); } else if (text.indexOf("Label") != -1) { String str = "Label: "; String lable = text.substring(text.indexOf(str) + str.length()).trim(); LOG.debug("setting label: " + lable); songInfo.setLable(lable); } else if (text.indexOf("Year") != -1) { String str = "Year: "; String year = text.substring(text.indexOf(str) + str.length()).trim(); LOG.debug("setting year: " + year); songInfo.setYear(year); } else if (text.toUpperCase().indexOf(title.toUpperCase()) != -1) { text = text.replaceAll("|", ""); StringTokenizer track = new StringTokenizer(text, "."); if (track.countTokens() != 2) { LOG.debug("ignoring: " + text); continue; } String trackNumber = track.nextToken(); LOG.debug("setting track: " + trackNumber); songInfo.setTrackNumber(trackNumber.trim()); } else if (text.indexOf("Digital") != -1) { String genre = text.trim().substring(0, text.indexOf("Digital")).trim(); LOG.debug("setting genre: " + genre); songInfo.setGenre(genre); } } LOG.info("complete"); } }
  13. I believe I found out why fetching the ID3 information from gracenote did not work for me most of the time. There is an amazon ad in the lower left corner that appears before the album list in the HTML source. The name of the link in the ad matched what PJ was looking for so PJ followed that link down to amazon instead of fetching the album track list from gracenote. I agree we would get much better name matches from pandora backstage but that's a little too suspicious to do as we are listening. So, I updated the gracenote code to zoom in on the HTML main area and ignore the ads. What's the procedure to submit this code?
×
×
  • Create New...