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__":
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")
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:
def signal_handler(signal, frame):
sys.stdout.write("\n")
sys.exit(0)
-
+
def tagid3(file,jour,mois,annee):
# {'ALBUM': ['Le moment Meurice'],
# 'TITLE': ['Le moment Meurice 13.11.2015'],
# OU
# 'TITLE': ['Chasse au pinson 11.11.2015'],
-# 'LENGTH': ['00h05m17s']}
+# 'LENGTH': ['00h05m17s']}
retval = 1
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__":
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)
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
# c.perform()
# c.close()
# sys.stdout.write("\nDone.\n")
-