Commits

MrTux Hdb  committed f8105c1

strip media_url text

  • Participants
  • Parent commits 5f35f74

Comments (0)

Files changed (4)

File NhacCuaTuiParser.py

             for artist in tree.findall('.//track/creator'):
                 self.song_artist.append(artist.text.strip())  # get song artist
             for media_url in tree.findall('.//track/location'):
-                self.song_link.append(media_url.text)   # get media url
+                self.song_link.append(media_url.text.strip())   # get media url
                 if media_url.text is not None:
-                    self.song_type.append(media_url.text.split('.')[-1])  # get media type
+                    self.song_type.append(media_url.text.strip().split('.')[-1])  # get media type
                 else:
                     self.song_type.append(None)
 

File NhacSoParser.py

             for artist in tree.findall('.//song/artist'):
                 self.song_artist.append(artist.text.strip())  # get song artist
             for media_url in tree.findall('.//song/mp3link'):
-                self.song_link.append(media_url.text)  # get media url
+                self.song_link.append(media_url.text.strip())  # get media url
                 if media_url.text is not None:
-                    self.song_type.append(media_url.text.split('.')[-1])  # get media type
+                    self.song_type.append(media_url.text.strip().split('.')[-1])  # get media type
                 else:
                     self.song_type.append(None)
 

File ZingMP3Parser.py

             for artist in tree.findall('./item/performer'):
                 self.song_artist.append(artist.text.strip())  # get song artist
             for media_url in tree.findall('./item/source'):
-                self.song_link.append(media_url.text)  # get media url
+                self.song_link.append(media_url.text.strip())  # get media url
             for child in root:
                 self.song_type.append(child.attrib['type'])  # get media file type
 

File ZingRadioParser.py

         for artist in tree.findall('./item/performer'):
             self.song_artist.append(artist.text.strip())  # get song artist
         for media_url in tree.findall('./item/source'):
-            self.song_link.append(media_url.text)  # get media url
+            self.song_link.append(media_url.text.strip())  # get media url
         for child in root:
             self.song_type.append(child.attrib['type'])  # get media file type