Code Monkey home page Code Monkey logo

cover_grabber's People

Contributors

thedonvaughn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

cover_grabber's Issues

Error walking through directories

I got this error while fetching the covers. It fails always in the same directory but I don't know which one.

Traceback (most recent call last):
File "/usr/bin/covergrabber", line 59, in
main()
File "/usr/bin/covergrabber", line 56, in main
media_walker = MediaDirWalker(opts["media_dir"], opts["overwrite"]).do_walk_path()
File "/usr/lib/python2.7/site-packages/cover_grabber/media_dir_walker.py", line 33, in do_walk_path
os.path.walk(self.path, self.process_dir, None)
File "/usr/lib64/python2.7/posixpath.py", line 237, in walk
walk(name, func, arg)
File "/usr/lib64/python2.7/posixpath.py", line 237, in walk
walk(name, func, arg)
File "/usr/lib64/python2.7/posixpath.py", line 229, in walk
func(arg, top, names)
File "/usr/lib/python2.7/site-packages/cover_grabber/media_dir_walker.py", line 58, in process_dir
downloader = LastFMDownloader(album_name, artist_name) # Set downloader type to be LastFM
File "/usr/lib/python2.7/site-packages/cover_grabber/lastfm_downloader.py", line 31, in init
self.url = self.format_url()
File "/usr/lib/python2.7/site-packages/cover_grabber/lastfm_downloader.py", line 35, in format_url
return self.LASTFM_URL.format(album_name=self.album_name)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)

NameError: traceback not defined

After some successful downloads I get a stack trace:

2015-05-05 01:36:34,938: cover_grabber :ERROR - Exception caught... Shutting down
Traceback (most recent call last):
  File "/usr/bin/covergrabber", line 68, in <module>
    main()
  File "/usr/bin/covergrabber", line 64, in main
    traceback.print_exc(file=stdout)
NameError: global name 'traceback' is not defined

XML namespace error on LastFM-API

I've got the following error on the LastFM API:
Errors in file xml-schema: The prefix "opensearch" for element "opensearch:Query" is not bound.
https://ws.audioscrobbler.com/2.0/?method=album.search&album=Foobar&api_key=a42ead6d2dcc2938bec2cda08a03b519 The link is equal to LASTFM_URL

After looking at the source i've removed the outer xml elements (including the namespaced <query> element) which aren't used by the parser.

# /cover_grabber/downloader/lastfm_downloader.py#L44
response = urllib.urlopen(self.url).read() # Send HTTP request to LastFM

# removing invalid formatted wrapper xml.
start_index = response.index("<albummatches>")
end_index = response.index("</albummatches>") + len("</albummatches>")
response = response[start_index:end_index]

xml_data = ETree.fromstring(response) # Read in XML data

Now the stripped response is passed to the xml parser and everything works again.
I could submit a pull request – Just let me know.

👻

:ERROR - SOMETHING VERY BAD HAPPENED on every run

The real bug here is that I don't have much to go on for debugging or troubleshooting.

Bonus feature requesting a "--verbose" switch here, too, which could be a good thing to have as well as a better error message.

$ covergrabber Nightwish/
2019-06-01 07:48:39,738: cover_grabber :INFO - Scanning Nightwish/
2019-06-01 07:48:39,767: cover_grabber :INFO - LastFM: Searching for "Nightwish - Once"
2019-06-01 07:48:40,211: cover_grabber :ERROR - SOMETHING VERY BAD HAPPENED during processing of "Nightwish - Once"
$ covergrabber Silverchair/
2019-06-01 07:48:59,096: cover_grabber :INFO - Scanning Silverchair/
2019-06-01 07:48:59,098: cover_grabber :INFO - LastFM: Searching for "Silverchair - Frogstomp"
2019-06-01 07:48:59,549: cover_grabber :ERROR - SOMETHING VERY BAD HAPPENED during processing of "Silverchair - Frogstomp"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.