Skip to content

Commit

Permalink
Sanitise filenames saved in meta
Browse files Browse the repository at this point in the history
  • Loading branch information
ping committed Oct 29, 2019
1 parent 7f8ec29 commit 52762ef
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions instagram_private_api_extensions/live.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
except ValueError:
# pragma: no cover
# To allow running in terminal
from compat import compat_urlparse # pylint: disable=relative-import
from compat import compat_urlparse


logger = logging.getLogger(__file__)
Expand Down Expand Up @@ -279,7 +279,8 @@ def _process_mpd(self, mpd):
segment_url = compat_urlparse.urljoin(self.mpd, seg_filename)

if representation_label:
self._store_segment_meta(os.path.basename(seg_filename), representation_label)
self._store_segment_meta(
os.path.basename(compat_urlparse.urlparse(seg_filename).path), representation_label)

# Append init chunk to first segment in the timeline for now
# Not sure if it's needed for every segment yet
Expand Down Expand Up @@ -522,7 +523,7 @@ def stitch(self, output_filename,
dl = Downloader(mpd=args.mpd, output_dir=args.o)
try:
dl.run()
except KeyboardInterrupt as e:
except KeyboardInterrupt:
logger.info('Interrupted')
if not dl.is_aborted:
dl.stop()
Expand Down

0 comments on commit 52762ef

Please sign in to comment.