]> git.parisson.com Git - deefuzzer.git/commitdiff
Fix for #51 (M3U input does not support relative paths)
authorachbed <github@achbed.org>
Sat, 24 Jan 2015 18:14:13 +0000 (12:14 -0600)
committerachbed <github@achbed.org>
Sat, 24 Jan 2015 18:14:13 +0000 (12:14 -0600)
Signed-off-by: achbed <github@achbed.org>
deefuzzer/station.py
example/deefuzzer_doc.xml

index f558e4e0719a7a6ee37258e955f81f7138374775..8f67229bfe9f9d72de2a2766d3101c7e288a8731 100644 (file)
@@ -288,6 +288,9 @@ class Station(Thread):
     def _path_add_base(self, a):
         return os.path.join(self.base_directory, a)
         
+    def _path_m3u_rel(self, a):
+        return os.path.join(os.path.dirname(self.source), a)
+        
     def _log(self, level, msg):
         try:
             obj = {}
@@ -419,8 +422,9 @@ class Station(Thread):
                     f = open(self.media_source, 'r')
                     try:
                         for path in f.readlines():
+                            path = path.strip()
                             if '#' != path[0]:
-                                fp = self._path_add_base(path.strip())
+                                fp = self._path_m3u_rel(path)
                                 if os.path.isfile(fp):
                                     file_list.append(fp)
                     except:
index e24c8eaabd99adbaae0d517da5662551b57856fd..20b68d0f6631aa89039eb4f7b45e4027aa5d583f 100644 (file)
@@ -48,7 +48,6 @@
                 - media/source (except for stations created using the stationfolder method)
                 - record/dir
                 - feeds/dir
-                - All paths read from the file specified by media/m3u or media/source
                 
               If the parameter path begins with a slash, it is assumed to be an absolute path and
               prepending does not occur (see https://docs.python.org/2/library/os.path.html#os.path.join )