Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Walmart' 500x500 album covers download script (Read 54667 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Walmart' 500x500 album covers download script

Helllo!

I would like to share my script for downloading covers from Walmart, which are 500x500 pixels!

Short usage:
walmart.py "keyword ... keyword" [dest_dir] [image_name_no_extension]

You can specify no parameters, only dest_dir parameter, or both dest_dir and image_name.
If you don't specify image_name, files will be named after artist and album name from Walmart search.
If you don't specify dest_dir, files will go to the current directory.

Example usage:
walmart.py "abbey lincoln straight ahead"
walmart.py "abbey lincoln straight ahead" "D:\Abbey Lincoln\Straight Ahead" "folder"

In the second case file will be saved as "D:\Abbey Lincoln\Straight Ahead\folder.jpg"
When multiple matches are found, they will be saved as folder.jpg, folder1.jpg, folder2.jpg...

For best experience, combine it with foo_openwith and write a preset for it. Then just a few clicks and cover is downloaded (if it's availlabe in Walmart store)
(foo_openwith configuration shown in the next post)

Cheers!

Get it now:
walmart.py

Update:
Removed some debug code. File updated.

Update:
Of cource, it needs Python installed to work. Grab it from python.org (the link). In case you don't know: it's something like Java Runtime Environement or .NET Runtime Environment that you probably have already installed (in fact it's not only RE, but SDK).

NEW:
Changed expressions for getting name of the file, to accomodate for
change in Wal-Mart pages. The script will work again! :-)
Hopefully, fixed problems with zip file too.

Walmart' 500x500 album covers download script

Reply #1
You can try to set
"Application path" to ""walmart.py", and
"Main Parameters" to 
Code: [Select]
"%artist% %album%" "$replace(%_path%,\%_filename_ext%,)" folder
in foo_openwith configuration.
Remember also to set Pre and Post parameters empty.

By the way, I use it for batch downloading with help of shell script, find, grep and sed (a bunch of unix tools)

Update:
"python.exe" before "walmart.py" is not needed.
Added "\" before "%_filename_ext%", wthout it command doesn't work.

Walmart' 500x500 album covers download script

Reply #2
Confirmed that it's working fine also on Windows.

Walmart' 500x500 album covers download script

Reply #3
I love your plug in/script!

I have a problem.  I had to do a clean install of foobar so I am trying to reinstall your script.  Now when I unzip the zip file it thinks walmart.py is a folder and unzips it as such.  Any idea on how I can prevent this from happening?

Walmart' 500x500 album covers download script

Reply #4
I can't actually download any images with the script. I've tried:

Code: [Select]
walmart.py "ZZ Top Rio Grande Mud" "path\to\music\" "folder"


and nothing happens. Could Walmart have changed something, or am I not using it right?

Walmart' 500x500 album covers download script

Reply #5
Same here!

 

Walmart' 500x500 album covers download script

Reply #6
just downloaded this, and the zip is apparently empty.

Walmart' 500x500 album covers download script

Reply #7
Quote
just downloaded this, and the zip is apparently empty.
[a href="index.php?act=findpost&pid=294938"][{POST_SNAPBACK}][/a]


Not here.

Walmart' 500x500 album covers download script

Reply #8
Quote
Quote
just downloaded this, and the zip is apparently empty.
[a href="index.php?act=findpost&pid=294938"][{POST_SNAPBACK}][/a]


Not here.
[a href="index.php?act=findpost&pid=294946"][{POST_SNAPBACK}][/a]

Maybe you're getting it from your cache? I can't get the ZIP to open either, whether I click it to download or right-click and "save as..." (using Firefox).

Walmart' 500x500 album covers download script

Reply #9
It appears that the archive is corrupted actually gzipped, rather than zipped:
Code: [Select]
> unzip walmart.py.zip
Archive:  walmart.py.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in walmart.py.zip,
        and cannot find walmart.py.zip.zip, period.
However when I tried gunzip, it worked:
Code: [Select]
> mv walmart.py.zip walmart.py.gz

> gunzip -v walmart.py.gz
walmart.py.gz:   51.4% -- replaced with walmart.py

> head -n 10 walmart.py
#!/bin/env python

#
# By Filip Kalinski, 2004 - filon@pld.org.pl
#

import urllib
import re
import sys
import os

Edit: To summarise, just rename the file to walmart.py.gz and most archivers should be able to handle it.

Edit: Scratch that, it is a zip, gunzip appears to be able to decompress it, for some weird reason... But the script doesn't download anything, just like scummboy and loft mentioned.

Walmart' 500x500 album covers download script

Reply #10
I fixed the archive (I believe) with WinRar

I can't figure out how to use it though. If somebody could explain it to me I'd love you  (I got about as far as my firewall alerting me that the script was using the internet. I okayed it but it doesn't download anything)

When I use the foo_openwith configuration, a python commandline pops up, is blank, and then closes. nothing is downloaded.

When I type in

Code: [Select]
walmart.py "the doors la woman" "H:\Music\The Doors" "folder"

it says "invalid syntax" and points to the second quotation. ???

Walmart' 500x500 album covers download script

Reply #11
I can't open that one either. It downloads and then 7-Zip can't do anything with it.

Walmart' 500x500 album covers download script

Reply #12
Quote
I can't open that one either. It downloads and then 7-Zip can't do anything with it.
[a href="index.php?act=findpost&pid=296463"][{POST_SNAPBACK}][/a]


try using WinRAR. I use IZArc, and whenever I have a problem unzipping a file, I use winrar. Usually winrar will work--if not, then the file is totally whack 

edit: try this one

Walmart' 500x500 album covers download script

Reply #13
Uploaded new version with changed expressions for getting name of the file, to accomodate for change in Wal-Mart pages.
The script will work again! :-)
Hopefully, fixed problems with zip file too.

walmart.zip

Cheers,
Filip

Walmart' 500x500 album covers download script

Reply #14
Quote
Uploaded new version with changed expressions for getting name of the file, to accomodate for change in Wal-Mart pages.
The script will work again! :-)
Hopefully, fixed problems with zip file too.

walmart.zip

Cheers,
Filip
[a href="index.php?act=findpost&pid=297307"][{POST_SNAPBACK}][/a]


worked  thanks.

the zip file is still corrupted ( made a fixed version if you're interested )

i know it's a shell script, so you can't really do this.. but it'd be pretty nice to be able to preview the images before downloading (because I downloaded like 5 files or so--2 of them which were relevant. it was a "best hits" cd, so it downloaded like three other artists' best hits.)

if it opened an explorer window or the actual images themselves after downloading that'd be pretty cool, so I could easily see what i downloaded

also, it overwrote the folder.jpg i already had in there (no biggie). it'd be kinda cool if it if it just went on to folder1.jpg or something if there was already a folder.jpg

all in all, very cool. thanks a lot. a great, simple, no nonsense program that I can run right out of foobar thanks to openwith. thanks a lot.

Walmart' 500x500 album covers download script

Reply #15
Looks like zips are getting corrupted in the upload process beacuse the file was correct befor uploading. I will try to re-submit the zip file, maybe it will help.

[attachment=1506:attachment]

Result:
Still doesn't work... And it's not allowed to post .py files. Damn!

Walmart' 500x500 album covers download script

Reply #16
Looks like handling of zips is broken. I will post 7-zip compressed file then.

[attachment=1510:attachment]

Walmart' 500x500 album covers download script

Reply #17
I still cannot access this file 7-Zip is telling me that it is not a supported archive.

Walmart' 500x500 album covers download script

Reply #18
Damn! The file is stripped of last 15 bytes! The same as with .zip file uploaded earlier. Aaarghhh....

Walmart' 500x500 album covers download script

Reply #19
It works here with IE or a download manager, but not with Firefox

Walmart' 500x500 album covers download script

Reply #20
Quote
It works here with IE or a download manager, but not with Firefox
[{POST_SNAPBACK}][/a]



Got it!  I guess IE is still good for SOMETHING! 

Edit:  Well...  The script isn't downloading anything.  I set it up with foo_openwith exactly as described in post #2 ([a href="http://www.hydrogenaudio.org/forums/index.php?showtopic=29920&view=findpost&p=258625]CLICK HERE[/url])

Any advice?

Walmart' 500x500 album covers download script

Reply #21
Quote
Quote
It works here with IE or a download manager, but not with Firefox
[{POST_SNAPBACK}][/a]



Got it!  I guess IE is still good for SOMETHING! 

Edit:  Well...  The script isn't downloading anything.  I set it up with foo_openwith exactly as described in post #2 ([a href="http://www.hydrogenaudio.org/forums/index.php?showtopic=29920&view=findpost&p=258625]CLICK HERE[/url])

Any advice?
[a href="index.php?act=findpost&pid=298918"][{POST_SNAPBACK}][/a]


double check to make sure everything's right

you have Python installed, correct?

does it open up the command prompt and do anything?

are you possibly trying to download the cover to a possibly rare cd or anything?

Walmart' 500x500 album covers download script

Reply #22
Quote
double check to make sure everything's right

you have Python installed, correct?

does it open up the command prompt and do anything?

are you possibly trying to download the cover to a possibly rare cd or anything?



The command window appears, stays empty, and closes.  I know the cover exists at Walmart.com.  I had it working a long time ago (as you can see by the 4th post in this thread.) 

Here is the "sample command" generated by foo_openwith:
Code: [Select]
C:\Program Files\foobar2000\walmart.py "Alice In Chains Jar Of Flies" "E:\FLAC\Alice In Chains\Jar Of Flies" folder

Walmart' 500x500 album covers download script

Reply #23
Maybe you code post the code in a CODE block, then people could just copy it and paste it into a .py file. I get a corrupt file, too.

Walmart' 500x500 album covers download script

Reply #24
Quote
Maybe you code post the code in a CODE block, then people could just copy it and paste it into a .py file. I get a corrupt file, too.
[a href="index.php?act=findpost&pid=304721"][{POST_SNAPBACK}][/a]


Good idea! Here it is.


Edit:
Deleted CODEBOX.
Damn! When doing CTRL+C, CTRL+V from codebox, spaces at beginning of the lines are discarded and it breaks any python script.