Skip to content

Commit

Permalink
Merge pull request #77 from akamhy/akamhy-patch-1
Browse files Browse the repository at this point in the history
download_worst = False
  • Loading branch information
akamhy authored Dec 24, 2021
2 parents dc39172 + 7074379 commit dda0056
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ In the following usage example the first three instance of VideoHash class are c
>>> from videohash import VideoHash
>>> # video: Artemis I Hot Fire Test
>>> url1 = "https://www.youtube.com/watch?v=PapBjpzRhnA"
>>> videohash1 = VideoHash(url=url1, download_worst=False)
>>> videohash1 = VideoHash(url=url1)
>>>
>>> videohash1.hash # video hash value of the file, value is same as str(videohash1)
'0b0011010000011111111011111111111110001111011110000000000000000000'
Expand Down
6 changes: 3 additions & 3 deletions tests/test_videohash.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def test_all():
videohash3 = VideoHash(url=source3)
hash3 = videohash3.hash
hash_hex3 = videohash3.hash_hex
assert hash3 == "0b0111000000011111111011111111111110001111011110000000000000000000"
assert hash_hex3 == "0x701fefff8f780000"
assert hash3 == "0b0011010000011111111011111111111110001111011110000000000000000000"
assert hash_hex3 == "0x341fefff8f780000"

assert hash1 == hash2
assert videohash1 == videohash2.bitlist
Expand All @@ -77,7 +77,7 @@ def test_all():
assert videohash1 - videohash3 != 2

source4 = "https://www.youtube.com/watch?v=_T8cn2J13-4"
videohash4 = VideoHash(url=source4)
videohash4 = VideoHash(url=source4, download_worst=True)
hash4 = videohash4.hash

assert hash4 != hash1
Expand Down
2 changes: 1 addition & 1 deletion videohash/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
)

__url__ = "https://akamhy.github.io/videohash/"
__version__ = "2.1.7"
__version__ = "2.1.8"
__status__ = "production"
__author__ = "Akash Mahanty"
__author_email__ = "[email protected]"
Expand Down
10 changes: 3 additions & 7 deletions videohash/videohash.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(
path: Optional[str] = None,
url: Optional[str] = None,
storage_path: Optional[str] = None,
download_worst: bool = True,
download_worst: bool = False,
frame_interval: Union[int, float] = 1,
) -> None:
"""
Expand All @@ -49,12 +49,8 @@ def __init__(
itself create the storage directory inside the
temporary directory of the system.
:param download_worst: If set to False, download the default quality of
yt-dlp downloader. yt-dlp usually default to the
best quality video available.
Worst quality might be an issue for some users,
they may set the download_worst to False.
The default value is True to conserve bandwidth.
:param download_worst: If set to True, download the worst quality video.
The default value is False to conserve bandwidth.
:param frame_interval: Number of frames extracted per unit time, the
default value is 1 per unit time. For 1 frame
Expand Down

0 comments on commit dda0056

Please sign in to comment.