Jump to content

MrDave2176

Active Members
  • Posts

    131
  • Joined

  • Last visited

Posts posted by MrDave2176

  1. So, I REALLY really want to get Pandora working! What can I do to make it stop saving the wrong song than the one I am listening to, and naming it wrong?

    What version of Pandora's jar are you running? Have you tried a clean install? Have you tried deleting all of your temp files? Do you have the relevant bits of your log? What version of FLASH are you using?

    We don't mind helping, but you have to give us something to work with.

  2. But if someone would like to maybe host the version that I am using just let me know.

    upload it to a webstorage like http://files.to or anything else

    The problem with that is that there is versioning to consider. It isn't the space (or the bandwidth either) it is someone who will keep track of which version does what and why. Also I like to see that the folks who make contributions are being recognised.

    Anyone can upload to those spots. In which case any joe blow could upload a corrupt or virused version and say it is an update. I'd like to think that if someone makes a clear commitment that they are hosting something (and can therefore be held liable) that they'd insure it was safe.

    That's my take on it.

    I apologise for the two weeks it took me to switch ips but going from cable internet to FiOS has been trickier than anticipated (since Verizon blocks port 80 those bastards).

    www.wildandbad.com and wildandbad.com both redirect to ww2.wildandbad.com:8181 and because of that can take a second or 30 to get to your page. If you get a 'page cannot be displayed' try reloading, it might be faster next time.

    if you want to go directly to the page try the ww2.wildandbad.com:8181 and see if that runs faster for you.

    I hesitate to use the LateNightGames as a mirror for this (unless W&B is completely down) since I have pretty strict bandwidth usage there. Anyone else who'd provide an ftp or http mirror for the files is welcome...I'll gladly link them directly.

    L0ki - yes, you can shut up now. (joke)

    You can still download 7.2 and (most) older versions from wildandbad.com. I've archived them there. Scroll down the page to HISTORY and look for the links on the versions. If you want to try to assemble your own 7.3 repack (which is 7.3 with the 7.2 jar file)

  3. As a sidenote...this may help making sense of the whole.

    With the next release I suggest we start a new thread. Then each successive release will start a new thread after that. This may help cut down on a lot of the redundant questions, mixed versions and lost people.

    It will also mean having to un-sticky the old thread or locking them after they are done, but hopefully some of the hak5 admins will help us with that.

  4. :!:

    I'm not sure what what version everyone else is running but my local versions works great (7.2 pandora jar in the 7.3 dist).

    A couple of things

    this download is bad:

    MIRROR: http://latenightgames.com/pandora/pandora.beta.7.3.zip

    It does not have the correct version jar which might explain the inconsistent behavior accoss users - this version does not play nice with pandoras new cache saving methodology which span multable dir - wrong titles will be saved when using this version.

    this download is better but still broken:

    http://wildandbad.com/pandora.beta.7.3.1.zip

    It has the updated logic to find the correct files but somehow the ITunes integration was broken.

    The pandora station lookup does not work anymore as Pandora disabled the javascript callbacks. I am using this field for creating ITunes playlist / station dir

    At some point I will attempt to integrate all updates into a single working dist - perhaps someone can volunteer to host

    As always, I am glad to host. I use 7.3.1 and it works fine for me. I am running Flash 8 and the latest Java on Firefox 1.5.0.4. I did find that putting the jacob.dll in my system32 folder fixed the itunes stuff.

    I'll gladly forwared the src files to you barley!!! I have if it'll help. I am very new to Java and so may have made mistakes along the way. But hopefully this will help to make a cohesive whole of the mixes.

  5. Ask in the Sticky-ed thred. And ripping from Pandora is illegal, I think it was a bad decision to put it in the show.

    I agree. That's why I use it as a timeshifting app. I shift a bunch of stuff while at work and then listen on the drive home and back on my ipod.

    I then synch when I get home and the ipod dumps everything that was on it.

    I am - admittedly - the likely exception to the rule.

    But that is why I support this app like I do. I get to discover new music, keep my last.fm up to date and occasionally learn new things (like Java programming for instance.)

    Even though I have never watched a single eppisode of the show (I know - sacreledge!) I am glad they did it since it brought me here.

  6. What happens when you use Flash 9 with Pandora's Jar? Because I just realized I have Flash 9. Is that why just about all of my songs have the wrong name associated with the song? I have 3 songs that have a diffent name yet play the same song. Is that what happens with flash 9?

    Thanks for replying to my last question, MrDave :)

    No problem.

    Flash 9 doesn't cache the files in the same place so they cannot be found by Pandora. If you have not dumped your cache then Pandora just keeps copying the same song over and over and over.

  7. Mr MrDave2176, and for those who are not self-compiling? ;-)

    Until this becomes a paying deal, it has to take a backseat to the job. There are still some things I'd like to get ironed out before a new release, and I've been trying to post them here.

    I had never done any Java programming in my life until I started tackling this project. I had done programming, just not in Java so it has been a learning curve for me.

    This is a ffairly easy project to work on since most of the hard stuff is done. Roll up you sleeves, and download the SDK and Ant. Plunge in with both feet. Trust me it has been educational and fun.

  8. everything is ok, i just report this error:

    "unable to retrieve bio from last.fm: Connection timed out: connect"

    i'm behind a firewall, does it matter? even if pandora is working?

    there is a way to change the time out value for sending info to las.fm?

    Last.fm has changed it's site and so until i get the newer version up the lastfm bio lookup stuff is not working.

    here is the code for LastFmLookup.java with my corrections for the new last.fm for those who are self-compiling.

    package util;
    
    
    
    import org.xml.sax.SAXException;
    
    import org.apache.commons.logging.Log;
    
    import org.apache.commons.logging.LogFactory;
    
    import org.dom4j.DocumentException;
    
    import org.dom4j.Document;
    
    import org.dom4j.Element;
    
    import org.dom4j.io.SAXReader;
    
    
    
    import java.io.IOException;
    
    import java.io.UnsupportedEncodingException;
    
    import java.net.URLEncoder;
    
    import java.net.URL;
    
    import java.security.NoSuchAlgorithmException;
    
    import java.security.MessageDigest;
    
    import java.util.Date;
    
    import java.util.Iterator;
    
    import java.text.DateFormat;
    
    import java.text.SimpleDateFormat;
    
    
    
    import com.meterware.httpunit.*;
    
    import server.Request;
    
    
    
    public class LastFmLookup {
    
    
    
        private static Log LOG = LogFactory.getLog(LastFmLookup.class);
    
    
    
        public static final String ERROR_BIO_NOT_FOUND = "band info not found";
    
        public static final String ERROR_NOT_FRIENDS_NOT_FOUND = "top friends not found";
    
        public static final String ERROR_SONG_STATS_NOT_FOUND = "No Stats found for song";
    
        public static final String ERROR_SONG_ART_NOT_FOUND = "No Album Art found for song";
    
        public static final String ERROR_SONG_LIKE_NOT_FOUND = "No Similar Artists found for song";
    
    
    
        public static String getBio(String artist) throws IOException, SAXException {
    
            WebConversation wc = new WebConversation();
    
            // Disable errors of javascript
    
            HttpUnitOptions.setExceptionsThrownOnScriptError( false );
    
            WebResponse   resp = wc.getResponse("http://last.fm/music/" + URLEncoder.encode(artist, "UTF-8") + "/+wiki");
    
            String text = resp.getText();
    
            
    
            int i = text.indexOf("View wiki recent changes page");
    
            if (i == -1) {
    
                throw new RuntimeException(ERROR_BIO_NOT_FOUND);
    
            }
    
            String startSearchString = "<div class="f">";
    
            String endSearchString = "<br style="clear:both;" />";
    
            int startBioIndex = text.indexOf(startSearchString) + startSearchString.length();
    
            if (startBioIndex < startSearchString.length()) {
    
                throw new RuntimeException(ERROR_BIO_NOT_FOUND);
    
            }
    
            int endBioIndex = text.indexOf(endSearchString, startBioIndex);
    
            if (endBioIndex == -1) {
    
                throw new RuntimeException(ERROR_BIO_NOT_FOUND);
    
            }
    
            return Util.addLastFmUrl(text.substring(startBioIndex, endBioIndex));
    
        }
    
    
    
        public static String getTopFans(String artist, String song) throws IOException, SAXException {
    
            LOG.info("looking up top fans");
    
    
    
            WebConversation wc = new WebConversation();
    
            HttpUnitOptions.setScriptingEnabled(false);
    
            HttpUnitOptions.setExceptionsThrownOnScriptError( false );
    
            String s = "http://www.last.fm/music/" + URLEncoder.encode(artist, "UTF-8") + "/_/" + URLEncoder.encode(song, "UTF-8");
    
            WebRequest req = new GetMethodWebRequest(s);
    
            WebResponse resp = wc.getResponse(req);
    
            String text = resp.getText();
    
            
    
            String startSearchString = "id="c_fanspanel" >";
    
            int startTopArtistIndex = text.indexOf(startSearchString)  + startSearchString.length();;
    
            if (startTopArtistIndex < startSearchString.length()) {
    
                throw new RuntimeException(ERROR_NOT_FRIENDS_NOT_FOUND);
    
            }
    
            int endTopArtistIndex = text.indexOf("<span class="mozillasucks">", startTopArtistIndex);
    
            return Util.addLastFmUrl(text.substring(startTopArtistIndex, endTopArtistIndex));
    
        }
    
    
    
        public static LastFmTrackStats getTrackStat(String artist, String song) throws IOException, SAXException {
    
            LastFmTrackStats lastFmTrackStats = new LastFmTrackStats();
    
    
    
            WebConversation wc = new WebConversation();
    
            HttpUnitOptions.setScriptingEnabled(false);
    
            HttpUnitOptions.setExceptionsThrownOnScriptError( false );
    
            String s = "http://www.last.fm/music/" + URLEncoder.encode(artist, "UTF-8") + "/_/" + URLEncoder.encode(song, "UTF-8");
    
            WebRequest req = new GetMethodWebRequest(s);
    
            LOG.info("fetching stats: " + s);
    
            WebResponse resp = wc.getResponse(req);
    
            String text = resp.getText();
    
    
    
            setTrackStats(text, lastFmTrackStats);
    
    
    
            setAlbumImageLocation(text, lastFmTrackStats);
    
    
    
            setSimilarArtist(text, lastFmTrackStats);
    
    
    
            return lastFmTrackStats;
    
        }
    
    
    
        private static void setSimilarArtist(String text, LastFmTrackStats lastFmTrackStats) {
    
            String startSearchString = "id="c_simpanel" >";
    
            int startSimilarIndex = text.indexOf(startSearchString) + startSearchString.length();
    
            if (startSimilarIndex < startSearchString.length()) {
    
                throw new RuntimeException(ERROR_SONG_LIKE_NOT_FOUND);
    
            }
    
            int endSimilarIndex = text.indexOf("<span class="mozillasucks">", startSimilarIndex);
    
            lastFmTrackStats.setSimilarArtist("<span>Similar Artists:</span> <br/>" + Util.addLastFmUrl(text.substring(startSimilarIndex, endSimilarIndex).trim()));
    
        }
    
    
    
        private static void setAlbumImageLocation(String text, LastFmTrackStats lastFmTrackStats) {
    
            String startSearchString = "<div class="cover">";
    
            String imgLoc = "";
    
            int endImageIndex = 0;
    
            int startImageIndex = text.indexOf(startSearchString) + startSearchString.length();
    
            if (startImageIndex < startSearchString.length()) {
    
                   LOG.info("No Amazon image, gotta look for a LastFM image");
    
                startSearchString = "c_avatarPanel">";
    
                startImageIndex = text.indexOf(startSearchString) + startSearchString.length();
    
                if(startImageIndex < startSearchString.length()) {
    
                    throw new RuntimeException(ERROR_SONG_ART_NOT_FOUND);
    
                }
    
                endImageIndex = text.indexOf("" border=", startImageIndex);
    
                imgLoc = text.substring(startImageIndex, endImageIndex).trim();
    
                imgLoc = imgLoc.substring(imgLoc.indexOf("src="") + 5, imgLoc.length());
    
                if(imgLoc == "http://static.last.fm/depth/sidebars/vw_view.gif") {
    
                    throw new RuntimeException(ERROR_SONG_ART_NOT_FOUND);
    
                }
    
            } else {
    
                endImageIndex = text.indexOf("" alt", startImageIndex);
    
                imgLoc = text.substring(startImageIndex, endImageIndex).trim();
    
                imgLoc = imgLoc.substring(imgLoc.indexOf("src="") + 5, imgLoc.length());
    
            }
    
            lastFmTrackStats.setAlbumImageLocation(imgLoc);
    
            LOG.info("got image location:" + imgLoc);
    
        }
    
    
    
        private static void setTrackStats(String text, LastFmTrackStats lastFmTrackStats) {
    
            String startSearchString = "id="c_infoPanel">";
    
            int startStatIndex = text.indexOf(startSearchString) + startSearchString.length();
    
            if (startStatIndex < startSearchString.length()) {
    
                throw new RuntimeException(ERROR_SONG_STATS_NOT_FOUND);
    
            }
    
            int endStatIndex = text.indexOf("<div class="f"", startStatIndex);
    
            lastFmTrackStats.setTrackStats(Util.addLastFmUrl(text.substring(startStatIndex, endStatIndex).trim()));
    
        }
    
    
    
        public static void addTrack(Request request) throws IOException, SAXException, NoSuchAlgorithmException {
    
    
    
            SongInfo songInfo = (SongInfo) request.getSession().getAttribute(Constants.ATTR_SONG_INFO);
    
    
    
            if (songInfo == null) {
    
                throw new RuntimeException("illegal call encountered: song info does not exist");
    
            }
    
    
    
            String userName = request.getParamter(Constants.PARAM_LAST_FM_USER_NAME);
    
            String password = request.getParamter(Constants.PARAM_LAST_FM_PASSWORD);
    
    
    
            LOG.debug("password = " + password);
    
            LOG.debug("userName = " + userName);
    
    
    
            if (userName == null || password == null) {
    
                throw new RuntimeException("last.fm authentication impossible.");
    
            }
    
    
    
            WebConversation wc = new WebConversation();
    
            WebRequest req = new PostMethodWebRequest("http://post.audioscrobbler.com");
    
            req.setParameter("u", userName);
    
            req.setParameter("c", "pja");
    
            req.setParameter("hs", "true");
    
            req.setParameter("v", "0.1");
    
            req.setParameter("p", "1.1");
    
            WebResponse res = wc.getResponse(req);
    
            String text = res.getText();
    
            String key = "";
    
            String lastFMUrl = "http://62.216.251.200/protocol_1.1";
    
            String[] strings = text.split("n");
    
            LOG.debug(text);
    
            if (strings.length < 3 || strings[0].indexOf("UPTODATE") == -1) {
    
                String msg = "Unable to authenticate to last.fm";
    
                LOG.warn("Unable to authenticate to last.fm: " + text);
    
                throw new RuntimeException(msg);
    
            } else {
    
                key = strings[1];
    
                lastFMUrl = strings[2];
    
            }
    
            Date date = new Date();
    
    
    
            DateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    
            req = new GetMethodWebRequest(lastFMUrl);
    
            req.setParameter("u", userName);
    
            String s = md5(md5(password) + key);
    
            LOG.debug("hex = " + s);
    
            req.setParameter("s", s);
    
            req.setParameter("a[0]", songInfo.getArtist());
    
            req.setParameter("t[0]", songInfo.getTitle());
    
            req.setParameter("b[0]", songInfo.getAlbum()!=null?songInfo.getAlbum():"");
    
            req.setParameter("m[0]", "");
    
            req.setParameter("l[0]", "255");
    
            req.setParameter("i[0]", simpleDateFormat.format(date));
    
            res = wc.getResponse(req);
    
            text = res.getText();
    
            if (text.indexOf("OK") == -1) {
    
                String msg = "a problem was encountered whille attempting to add track to last.fm: " + text;
    
                LOG.warn(msg);
    
                throw new RuntimeException(msg);
    
            }
    
            LOG.info("successfully added track to last.fm");
    
    
    
        }
    
    
    
        public static String getStationName(String pandoraUserName, String stationId) throws IOException, DocumentException {
    
            LOG.info("looking up station name for station with id: " + stationId + " user: " + pandoraUserName);
    
            URL url = new URL("http://feeds.pandora.com/feeds/people/" + pandoraUserName + "/stations.xml?max=100");
    
            Document document = parse(url);
    
            Iterator list = document.getRootElement().element("channel").elementIterator("item");
    
    
    
            while (list.hasNext()) {
    
                Element o = (Element) list.next();
    
                String value = o.element("link").getText();
    
                if (value.indexOf(stationId) != -1) {
    
                    String stationName = o.element("title").getText();
    
                    LOG.info("found station name: " + stationName);
    
                    return stationName;
    
                }
    
            }
    
            throw new RuntimeException("station with id: " + stationId + " not found. user: " + pandoraUserName);
    
        }
    
    
    
        private static Document parse(URL url) throws DocumentException {
    
            SAXReader reader = new SAXReader();
    
            return reader.read(url);
    
        }
    
    
    
        private static String md5(String message) throws NoSuchAlgorithmException, UnsupportedEncodingException {
    
            MessageDigest md = MessageDigest.getInstance("MD5");
    
            return hex(md.digest(message.getBytes("CP1252")));
    
        }
    
    
    
        private static String hex(byte[] array) {
    
            StringBuffer sb = new StringBuffer();
    
            for (int i = 0; i < array.length; ++i) {
    
                sb.append(Integer.toHexString((array[i] & 0xFF) | 0x100).toLowerCase().substring(1, 3));
    
            }
    
            String s = sb.toString();
    
            LOG.debug("s = " + s);
    
            return s;
    
        }
    
    
    
    }

    I THINK this is the only file with changes, I could be wrong, but feel free to try it.

  9. I just cannot get this to finish working for the life of me. When I go to it, and have it on cruise control, it never seems to finish downloading a song. It just says "Fetching ID3 information and tagging MP3 for artist." and then never goes past that until that song ends and it goes into the next one.

    same as mine and when i even pause the song so it dosent go to the next it will finally say it saved. When i go to play the song its a completely diffrerent song and its always 1.10 mb!!!!! pissing me off. i put cruise control off and do im manually around the middle/end of song. any ideas dave?

    I am not having this problem, so it is tough to say why it it is happeneing to you. Try turning off the cddb lookup and see if it is still doing it. Then I'd know what is where the problem lies.

  10. I figured out that last.FM has changed their sight ever so slightly . So that has broken all of the Picture, fan, and bio links.

    I've got it fixed, but I'll be putting in some other fixes to the skins files and I am looking at this 'recent' file' thing.

    you can look at that part for yourself. THis is in Mp3Processor.java

        public static void joinMp3s(List<File> mp3s, File lookinDir) throws IOException {
    
            LOG.debug("n***processing directory: " + lookinDir.getName() + "***n");
    
            File[] files = lookinDir.listFiles();
    
            sortFilesByLastModified(files);
    
    
    
            //uncomment to print files in each working directory
    
            //printFiles(files);
    
    
    
            for (File currentFile : files) {
    
                if (!currentFile.isDirectory()) {
    
                    if (isMp3(currentFile)) {
    
                        LOG.debug("mp3 found adding currentFile: " + currentFile.getName());
    
                        mp3s.add(currentFile);
    
                    } else {
    
                        if (isFileRecent(currentFile)) {
    
                            LOG.debug("recent non mp3 file found: " + currentFile.getName() + " - will continue to next file");
    
                            continue;
    
                        }
    
                        LOG.debug("non-recent non mp3 file found: " + currentFile.getName() + " - will continue to next file");
    
                        continue;
    
                    }
    
                } else {
    
                    joinMp3s(mp3s, currentFile);
    
                }
    
            }
    
            LOG.debug("n***Finished directory: " + lookinDir.getName() + "***n");
    
            return;
    
        }

    What I've done is forced it to recurse through all of the directories before giving up. This is less than efficient, but until I hear a better idea, that's what I'm working with.

  11. Here's a bug (I think) for someone to look into. In Mp3Processor.java, in function joinMp3s, the accumulated file array might be wrong. The "for" loop exits with a 'LOG.debug("no more mp3 found in dir"); return;' when a non-directory, non-mp3, non-recent file is found. If that happens before the plugtmp (or plugtmp-x) directory is processed in the "for" loop, the function doesn't recurse and process that directory. That can be seen in the log file output when the same file is saved multiple times with the wrong filename and tagging. The determination of "non-recent" is in isFileRecent, where it appears that "recent" is within 3 hours. When you delete the plugtmp (and/or plugtmp-x) directory and start clean, you can see the problem happen 3 hours into the running of the program.

    Until fixed, I think stopping the program, cleaning up, restarting, should eliminate that problem.

    Comments? Am I all wet?

    Actually that would explain a lot.

    What if it deleted the files once it moved them? I mean really if it can't move them while they are playing then it won't remove anything being played, right?

  12. Also, when I change the settings in pandora.jar (using the Firefox browser) and click "save", I don't see any files modified with the current Pandora directory (or the subs). Is this supposed to save changes (such as default directory, autosurf) to a config file (default.properties?)?

    It saves the settings in a cookie, not a file. So that doesn't surprise me. ;)

    A lot of these recent space of problems sounds almost as if the files aren't being unzipped to the proper directory.

    If you are RUNNING PandorasJar and try to overwrite the jar file it will cause an error and it won't get upgraded.

    Try unzipping to a 'clean' directory and then running it from there. If that works then copy it over to your normal installation directory. (This is a good practice anyways since you don't want to accidently overwrite properties files and such by accident.)

    Try renaming your pandora.jar file to pandora_old.jar before copying the new files into the installation.

  13. I'm still getting the following:

    We're sorry, the minimized pandora player has moved.

    Please update your bookmark to http://www.pandora.com?cmd=mini .

    my system:

    Windows XP Service Pack2

    Firefox 1.5.0.4

    Flash Payer 8

    Pandoras Jar pandora.beta.7.3.1

    I've read through the thread and cannot see what else to try, I have been installing over the top replacing all files that match.

    Somewhere along the line you've gotten an OLD pandoraGrabber.html file.

    Try installing to a clean directory and if it works, just copy everything over to your normal installation.

  14. In my jar log I noticed "unsupported action:version" sometimes appears. The program still rips ok, I was just wondering if anyone else has notice that?

    I am using beta.7.3_repack

    7.3 repack is the 7.3 skins and the 7.2 jar file. 7.2 didn't support the 'version' function and hence the error. It is plenty ignorable. It was just my way of telling what version of the jar file people were running. It works...I know you are running 7.2 or earlier. :)

    Try 7.3.1 http://wildandbad.com/pandora.beta.7.3.1.zip

  15. Problem again:

    Running the pandora.jar v7.3. Was using all default directories (c:pandora). Everything worked great. I changed the default to d:pandora. I would get the downloaded information (artist/picture) but not the songs. Rather, an error would show up in the Java window asking me to check to make sure I had Firefox.

    Double checked:

    default.properties: mp3.archive.path=D:/pandora/

    Any hints on what is causing this problem?

    This may seem like a silly question... but do you have a D:/Pandora folder on an existing D: drive?

×
×
  • Create New...