hbmartin commited on
Commit
ffde4a3
·
1 Parent(s): 2fb9e79

expiration in UTC

Browse files
Files changed (2) hide show
  1. pytube/streams.py +1 -1
  2. tests/test_streams.py +1 -1
pytube/streams.py CHANGED
@@ -174,7 +174,7 @@ class Stream:
174
  @property
175
  def expiration(self) -> datetime:
176
  expire = parse_qs(self.url.split("?")[1])["expire"][0]
177
- return datetime.fromtimestamp(int(expire))
178
 
179
  @property
180
  def default_filename(self) -> str:
 
174
  @property
175
  def expiration(self) -> datetime:
176
  expire = parse_qs(self.url.split("?")[1])["expire"][0]
177
+ return datetime.utcfromtimestamp(int(expire))
178
 
179
  @property
180
  def default_filename(self) -> str:
tests/test_streams.py CHANGED
@@ -61,7 +61,7 @@ def test_title(cipher_signature):
61
 
62
 
63
  def test_expiration(cipher_signature):
64
- assert cipher_signature.streams[0].expiration == datetime(2020, 1, 15, 21, 12, 5)
65
 
66
 
67
  def test_caption_tracks(presigned_video):
 
61
 
62
 
63
  def test_expiration(cipher_signature):
64
+ assert cipher_signature.streams[0].expiration == datetime(2020, 1, 16, 5, 12, 5)
65
 
66
 
67
  def test_caption_tracks(presigned_video):