Skip to content

Commit

Permalink
fix: Fix filename display (skorokithakis#244)
Browse files Browse the repository at this point in the history
* Fix filename display

..when casting local files or direct urls.

* Fix guessed_content_type

..that used the now changed video_title property
  • Loading branch information
theychx authored Feb 27, 2020
1 parent 49e7fe2 commit 7c68a3e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions catt/stream_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ def extractor(self):
@property
def video_title(self):
if self.is_local_file:
return Path(self._local_file).name
return Path(self._local_file).stem
elif self._is_direct_link:
return self._preinfo["webpage_url_basename"].split(".")[0]
return Path(self._preinfo["webpage_url_basename"]).stem
elif self.is_remote_file or self.is_playlist_with_active_entry:
return self._info["title"]
else:
Expand All @@ -119,7 +119,7 @@ def video_thumbnail(self):
@property
def guessed_content_type(self):
if self.is_local_file:
return guess_mime(self.video_title)
return guess_mime(Path(self._local_file).name)
elif self._is_direct_link:
return guess_mime(self._info["webpage_url_basename"])
else:
Expand Down

0 comments on commit 7c68a3e

Please sign in to comment.