Quantcast
Channel: Kodi Community Forum - All Forums
Viewing all articles
Browse latest Browse all 84817

Unable to Save File

$
0
0
I'm trying to add some new stuff to Artist Slideshow, including images and bios from theaudiodb.com. No matter what I try, I can't save the file generated by theaudiodb.com. For instance, here's the URL for Adele (using their test key - same result if I use mine):

http://www.theaudiodb.com/api/v1/json/1/...bd8779e493

Even if I copy the entire file by hand, put it in a local file, have my script read the file, then write it back out, I get a blank file. If I remove everything after the English bio, then it works fine. So there is some encoding trick I don't know to write out the file, but for the life of me I can't figure out what it is.

Here are three sets of code that don't work:

What I Started With:
Code:
urllib.urlretrieve( self.url, filename )

First Alternate Try:
Code:
raw_file = open( filename, 'w')
raw_file.write( urllib.urlopen( self.url ).read() )
raw_file.close()

Test With Local File:
Code:
test_file = open( filename + '.txt' ).read()
raw_file = open( filename, 'w')
raw_file.write( test_file )
raw_file.close()

I also tried using urllib2 with the same level of success.

Again, the last one works if I delete everything in theaudiodb.com file after the English bio. I'm really beginning to hate extended character sets.

Viewing all articles
Browse latest Browse all 84817

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>