Created
January 27, 2020 17:10
-
-
Save FloPinguin/f1ead610661ec4c6964b7eac86452bda to your computer and use it in GitHub Desktop.
Get the video count and size in GB of a internet archive item which contains mp4s. ia (https://github.com/jjjake/internetarchive) must be installed.
This file contains hidden or 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
import subprocess | |
import io | |
out = subprocess.check_output("ia list " + input() + " -c size -g *.mp4", shell=True) | |
string = io.StringIO(out.decode("utf-8")) | |
count = 0 | |
total_bytes = 0 | |
for line in string: | |
count += 1 | |
total_bytes += int(line) | |
print(str(count) + " videos") | |
print(str(total_bytes / 1000000000) + " GB") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment