-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from SimLeek/jit_vids
Jit vids
- Loading branch information
Showing
6 changed files
with
34 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,3 +108,4 @@ venv.bak/ | |
.idea/ | ||
.pytest_cache/ | ||
.coveragerc | ||
*.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,34 @@ | ||
# Fractal test is from: https://www.youtube.com/watch?v=WgXQ59rg0GM | ||
|
||
import os | ||
from pathlib import Path | ||
|
||
test_video = os.path.join(os.path.dirname(__file__), "fractal test.mp4") | ||
test_video_2 = os.path.join(os.path.dirname(__file__), "fractal test 2.mp4") | ||
test_video = str(Path.joinpath(Path(__file__).parent, "fractal test.mp4")) | ||
test_video_2 = str(Path.joinpath(Path(__file__).parent, "fractal test 2.mp4")) | ||
test_video_3 = str(Path.joinpath(Path(__file__).parent, "fractal test 3.mp4")) | ||
|
||
urls = { | ||
"test_video": "https://www.youtube.com/watch?v=LpWhaBVIrZw", | ||
"test_video_2": "https://www.youtube.com/watch?v=GASynpGr-c8", | ||
"test_video_3": "https://www.youtube.com/watch?v=u_P83LcI8Oc" | ||
} | ||
|
||
|
||
def populate_videos(fps=60, res="720p", ext="mp4"): | ||
from pytube import YouTube # Note: pip install pytube3, not pytube | ||
from pathlib import Path | ||
for n, v in globals().items(): | ||
if 'test_video' in n: | ||
print(f"Checking if '{n}' is downloaded.") | ||
if Path(v).exists(): | ||
print("Video already downloaded.") | ||
else: | ||
the_path = Path(v) | ||
print("Downloading...") | ||
YouTube(urls[n]) \ | ||
.streams \ | ||
.filter(fps=fps, res=res, file_extension=ext)[0] \ | ||
.download(output_path=the_path.parent, filename=the_path.stem) | ||
|
||
|
||
if __name__ == "__main__": | ||
populate_videos() |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = 'displayarray' | ||
version = '1.1.0' | ||
version = '1.1.1' | ||
description = 'Tool for displaying numpy arrays.' | ||
authors = ['SimLeek <[email protected]>'] | ||
license = 'MIT' | ||
|