Removed vids so cloning doesn't take forever.

This commit is contained in:
simleek
2020-05-19 18:46:27 -07:00
parent a2496fc511
commit 7bc3196079
4 changed files with 32 additions and 3 deletions
+1
View File
@@ -108,3 +108,4 @@ venv.bak/
.idea/
.pytest_cache/
.coveragerc
*.mp4
+31 -3
View File
@@ -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.