Skip to content

Instantly share code, notes, and snippets.

@rcastellotti
Created November 21, 2022 15:42
Show Gist options
  • Save rcastellotti/7d9ef631c4cff689b89ed07982513416 to your computer and use it in GitHub Desktop.
Save rcastellotti/7d9ef631c4cff689b89ed07982513416 to your computer and use it in GitHub Desktop.
A simple rayplay.it python downloader with no external dependencies
from urllib.request import urlopen
import subprocess
import json
import argparse
def download(url):
with urlopen(url.replace(".html", ".json")) as response:
body = response.read()
payload = json.loads(body)
print(f"[rpdl]: downloading {payload['name']}")
subprocess.run(
[
"ffmpeg",
"-i",
payload["video"]["content_url"],
f"./{payload['name'].replace('/','-')}.mp4",
]
)
if __name__ == "__main__":
parser = argparse.ArgumentParser(
prog="rpdl", description="download raiplay.it videos"
)
parser.add_argument("url", help="URL of the content to download")
args = parser.parse_args()
download(args.url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment