Created
November 24, 2022 20:29
-
-
Save DerBunteBall/96616c1d26287a63530f57772ebc041e to your computer and use it in GitHub Desktop.
BC extract and DL
This file contains 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
#!/usr/bin/env python3 | |
from datetime import datetime | |
import sys | |
import subprocess | |
import requests | |
def main(): | |
username = sys.argv[1] | |
now = datetime.now() | |
filename = "bongacams_"+username+"_"+str(now.strftime("%Y%m%d-%H%M%S"))+".mp4" | |
headers = { | |
'Content-Type': 'application/x-www-form-urlencoded', | |
'Referer': 'https://de.bongacams.net/' + username, | |
'Accept': 'application/json, text/javascript, */*; q=0.01', | |
'X-Requested-With': 'XMLHttpRequest', | |
"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0" | |
} | |
data = 'method=getRoomData&args%5B%5D=' + username + '&args%5B%5D=false' | |
r = requests.post('https://de.bongacams.net/tools/amf.php', data=data, headers=headers) | |
if r.status_code == 200: | |
info_json = r.json() | |
hls_source = "https:" + info_json['localData']['videoServerUrl'] + "/hls/stream_" + username + "/playlist.m3u8" | |
cmd = ["ffmpeg", "-i", hls_source, "-user_agent", headers["User-Agent"], "-c:a", "copy", "-c:v", "copy", filename] | |
ff = subprocess.Popen(cmd) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment