I've xml files with URLs to mp3 files. Is there a software out there that could read the xml file and start downloading all the mp3 files listed in the xml file?
-
-
Answer:
You don't need an additional software for that simple task. Execute something like the following in the folder your xmlfile is found (by replacing the dots at the beginning by spaces or tabulators and 'TP' by 'http') in Python (you don't have? Get it at http://python.org ) def download(file): ..import urllib ..file = open(file, 'r') ..document = file.read() ..for charpos in range(len(document))[3:]: ....if document[charpos-4:charpos] == '.mp3': ......music = urllib.urlopen(document[document[:charpos].rindex('TP://') : charpos]) ......localfile = open( document[document[:charpos].rindex('/')+1 : charpos], 'w' ) ......localfile.write(music.read()) ......music.close() ......localfile.close() ..file.close() download('yourxmlfile.xml')
wekkaw at Answerbag.com Visit the source
Related Q & A:
- How to Read xml file in java?Best solution by Stack Overflow
- how to parse a xml file using jquery and phonegap?Best solution by Stack Overflow
- How to write XML file with Java and read it?Best solution by Stack Overflow
- How to convert a HTML file to XML file?Best solution by Stack Overflow
- How do I convert mp3 files?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.