From: lionel G Date: Tue, 10 May 2016 16:10:38 +0000 (+0200) Subject: Patched : taglib for Fromet and Meurice because file is in archive directory X-Git-Url: http://gitweb.enneade.fdn.org/?a=commitdiff_plain;h=b245bacdaf9473b10b1ceaaabd9e6b47cdb360ec;p=podcast-rf.git Patched : taglib for Fromet and Meurice because file is in archive directory --- diff --git a/fromet.py b/fromet.py index 20eefa5..4d3a9a5 100755 --- a/fromet.py +++ b/fromet.py @@ -119,8 +119,8 @@ def tagid3(file,jour,mois,annee): retval = id3info.save() except: - print("Error setting tag for " + file) - print("id3info.tags : " + id3info.tags) + print("Error setting tag for file : " + file) + #print("id3info.tags : " + id3info.tags) return retval if __name__ == "__main__": @@ -167,7 +167,7 @@ if __name__ == "__main__": c.setopt(c.NOSIGNAL, 1) c.perform() c.close() - tagid3(name,jour,mois,annee) + tagid3(fullpath,jour,mois,annee) # sys.stdout.write(str(i.titre[0:29]) + "\n") sys.stdout.write("\r") sys.stdout.write("\nDone.\n") diff --git a/meurice.py b/meurice.py index 573db04..dab991d 100755 --- a/meurice.py +++ b/meurice.py @@ -54,7 +54,7 @@ class emmission: def readXml(self): from xml.dom.minidom import parse - self.doc = parse('rss_13942.xml') + self.doc = parse('rss/rss_13942.xml') def getRootElement(self): if self.__currentNode__ == None: @@ -88,7 +88,7 @@ class emmission: def signal_handler(signal, frame): sys.stdout.write("\n") sys.exit(0) - + def tagid3(file,jour,mois,annee): # {'ALBUM': ['Le moment Meurice'], @@ -106,7 +106,7 @@ def tagid3(file,jour,mois,annee): # 'TITLE': ['Le moment Meurice 13.11.2015'], # OU # 'TITLE': ['Chasse au pinson 11.11.2015'], -# 'LENGTH': ['00h05m17s']} +# 'LENGTH': ['00h05m17s']} retval = 1 @@ -119,8 +119,8 @@ def tagid3(file,jour,mois,annee): retval = id3info.save() except: - print("Error setting tag for " + file) - print("id3info.tags : " + id3info.tags) + print("Error setting tag for file : " + file) + #print("id3info.tags : " + id3info.tags) return retval if __name__ == "__main__": @@ -152,13 +152,14 @@ if __name__ == "__main__": mois = name.split(".")[1] annee = name.split(".")[2] name = annee + "." + mois + "." + jour + ".mp3" + fullpath = "archives/" + "Guillaume MEURICE" + "/" + name - sys.stdout.write(str(name)) - if not os.path.isfile(name): - with open(name, 'wb') as f: + #sys.stdout.write(str(name)) + if not os.path.isfile(fullpath): + with open(fullpath, 'wb') as f: c = pycurl.Curl() c.setopt(c.URL, str(i.guid)) - c.setopt(c.WRITEDATA, f) + c.setopt(c.WRITEDATA, f) c.setopt(c.MAXREDIRS, 5) c.setopt(c.NOPROGRESS, 1) c.setopt(c.CONNECTTIMEOUT, 30) @@ -166,7 +167,7 @@ if __name__ == "__main__": c.setopt(c.NOSIGNAL, 1) c.perform() c.close() - tagid3(name,jour,mois,annee) + tagid3(fullpath,jour,mois,annee) sys.stdout.write("\r") sys.stdout.write("\nDone.\n") # curses.endwin() # ...revenir à la console @@ -190,4 +191,3 @@ if __name__ == "__main__": # c.perform() # c.close() # sys.stdout.write("\nDone.\n") -