Skip to content

Commit

Permalink
Fixed: Not retrieving time for publish_date #29
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanBindez committed Mar 20, 2024
1 parent a0a66c6 commit 459d5bf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion push.Makeline
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
git add .
git commit -m 'Docs Update'
git commit -m 'Fixed: Not retrieving time for publish_date #29'
git push -u origin main
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "pytubefix"
version = "2.3.1"
version = "2.3.2"
authors = [
{ name="Juan Bindez", email="[email protected]" },
]
Expand Down
7 changes: 3 additions & 4 deletions pytubefix/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,16 @@ def publish_date(watch_html: str):
The html contents of the watch page.
:rtype: str
:returns:
Publish date of the video.
Publish date of the video in ISO format with timezone.
"""
try:
result = regex_search(
r"(?<=itemprop=\"datePublished\" content=\")\d{4}-\d{2}-\d{2}",
r"(?<=itemprop=\"datePublished\" content=\")\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}-\d{2}:\d{2}",
watch_html, group=0
)
except RegexMatchError:
return None
return datetime.strptime(result, '%Y-%m-%d')

return result

def recording_available(watch_html):
"""Check if live stream recording is available.
Expand Down
2 changes: 1 addition & 1 deletion pytubefix/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "2.3.1"
__version__ = "2.3.2"

if __name__ == "__main__":
print(__version__)

0 comments on commit 459d5bf

Please sign in to comment.