diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index fdd4bc6..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..5dbcc58 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +data/*.index filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore index 476f47e..f838e3c 100644 --- a/.gitignore +++ b/.gitignore @@ -130,3 +130,6 @@ dmypy.json # Gradio gradio_cached_examples/ + +# MacOS +.DS_Store \ No newline at end of file diff --git a/data.py b/data.py new file mode 100644 index 0000000..57dda0a --- /dev/null +++ b/data.py @@ -0,0 +1,29 @@ +import os +import json +import shutil + +from videohash import filepath_from_url + +with open('apb2022.json') as filein: + urls, videos, url2video, video2url = [], [], {}, {} + for item in json.load(filein): + urls.append(item['url']) + videos.append(item['mp4']) + url2video[item['url']] = item['mp4'] + video2url[item['mp4']] = item['url'] + +for url in videos: + filepath = filepath_from_url(url) + '.index' + datapath = os.path.join('data', os.path.basename(filepath)) + if not os.path.exists(filepath) and os.path.exists(datapath): + shutil.copyfile(datapath, filepath) + + +if __name__ == "__main__": + from videomatch import get_video_index + + for url in videos: + get_video_index(url) + filepath = filepath_from_url(url) + '.index' + datapath = os.path.join('data', os.path.basename(filepath)) + shutil.copyfile(filepath, datapath) \ No newline at end of file diff --git a/data/0fd24e056447f6cd068f40ba2e41828c.index b/data/0fd24e056447f6cd068f40ba2e41828c.index new file mode 100644 index 0000000..5524496 --- /dev/null +++ b/data/0fd24e056447f6cd068f40ba2e41828c.index @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d304bf65b174cc6d446536e183062988d13450eb27d6e1490b6024813cfca61 +size 18035 diff --git a/data/1de5e559d3d190ca09ac3fa6b40a0138.index b/data/1de5e559d3d190ca09ac3fa6b40a0138.index new file mode 100644 index 0000000..b850343 --- /dev/null +++ b/data/1de5e559d3d190ca09ac3fa6b40a0138.index @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a81da7184d4a73b80512031805e28d76adbf45c508b16cde173a9cc980104b48 +size 5395 diff --git a/data/265732a300bbe18c4d39df108fe0c121.index b/data/265732a300bbe18c4d39df108fe0c121.index new file mode 100644 index 0000000..21be4b1 --- /dev/null +++ b/data/265732a300bbe18c4d39df108fe0c121.index @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c3d30c03a7817befd97b670f124e80bfcd2c6862a3bf3d0a57bdb7c5cad7122b +size 284155 diff --git a/data/2909574cb590231c5d1028032bd849a8.index b/data/2909574cb590231c5d1028032bd849a8.index new file mode 100644 index 0000000..f584428 --- /dev/null +++ b/data/2909574cb590231c5d1028032bd849a8.index @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8634dffda2a11307f55712a079bba4e0e38895f9f3836d26c5a32a051580cfcd +size 6287235 diff --git a/data/2f71b6c1d5c91c4b73eef2ebd05bd848.index b/data/2f71b6c1d5c91c4b73eef2ebd05bd848.index new file mode 100644 index 0000000..7323844 --- /dev/null +++ b/data/2f71b6c1d5c91c4b73eef2ebd05bd848.index @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4357ef337a87f67f43283e770eb444c2261f3233c64d6aef04f671a1b4237780 +size 3725195 diff --git a/data/75617545ba72efdc9a7b2b140184a9c6.index b/data/75617545ba72efdc9a7b2b140184a9c6.index new file mode 100644 index 0000000..4661c2d --- /dev/null +++ b/data/75617545ba72efdc9a7b2b140184a9c6.index @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c28e09d9cee38776ad698e56209573f2e3f9f67a533b10b9001a25b39e34321e +size 3305875 diff --git a/data/9c0a24aa59358ee014ded54c88eaa6c1.index b/data/9c0a24aa59358ee014ded54c88eaa6c1.index new file mode 100644 index 0000000..6600b20 --- /dev/null +++ b/data/9c0a24aa59358ee014ded54c88eaa6c1.index @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:35786ba354b46631f880ff468b04f234dd0a8fff1ea159385d9a252272a53595 +size 294515 diff --git a/data/a3efa8f2e01e0964d7987e6b1e4b3b44.index b/data/a3efa8f2e01e0964d7987e6b1e4b3b44.index new file mode 100644 index 0000000..4fbaf9f --- /dev/null +++ b/data/a3efa8f2e01e0964d7987e6b1e4b3b44.index @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ab33d752701be55ece43a841e0318a7a8eb717c9fb3c09c9e9cccd57528f65b +size 5395 diff --git a/data/b3cf94671de7aadc22970483150aafd5.index b/data/b3cf94671de7aadc22970483150aafd5.index new file mode 100644 index 0000000..11c63a3 --- /dev/null +++ b/data/b3cf94671de7aadc22970483150aafd5.index @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:30157e51167c48c9e9da8400bd2efb4db730cf99060ec6b958e593caf4b934ca +size 3075 diff --git a/data/d0369414718aa9573ff9d009f4f61cc0.index b/data/d0369414718aa9573ff9d009f4f61cc0.index new file mode 100644 index 0000000..1570c31 --- /dev/null +++ b/data/d0369414718aa9573ff9d009f4f61cc0.index @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da68a19cadf2abcba5da6660393547599ae3a70f73c683ce236962f44a6f24ce +size 6520355