]> gitweb.maison.local Git - podcast-rf.git/commitdiff
Patched : taglib for Fromet and Meurice because file is in archive directory
authorlionel G <lionel@stargate.enneade.fdn.org>
Tue, 10 May 2016 16:10:38 +0000 (18:10 +0200)
committerlionel G <lionel@stargate.enneade.fdn.org>
Tue, 10 May 2016 16:10:38 +0000 (18:10 +0200)
fromet.py
meurice.py

index 20eefa5551f6f92f70c64eecf7f984b69fb111c6..4d3a9a5cf9c6087e9d884383dfeb47f034f35892 100755 (executable)
--- 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")
index 573db040cda683a0fc6be5c4589ba11bf0b52761..dab991d6e141bd06d8b2381ef5e9d1a721e1e8b8 100755 (executable)
@@ -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")
-