Skip to content

Instantly share code, notes, and snippets.

@FloPinguin
Created January 27, 2020 17:10
Show Gist options
  • Save FloPinguin/f1ead610661ec4c6964b7eac86452bda to your computer and use it in GitHub Desktop.
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.
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