This commit is contained in:
louiscklaw
2025-01-31 21:09:15 +08:00
parent fd583f2c63
commit 235b44cf96
34 changed files with 1017 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import subprocess
import os,sys
def download_broadcast(resources_url = 'https://twitter.com/i/broadcasts/1OyKAWRYeOgJb'):
cwd = os.path.dirname(__file__)
command = ' '.join(["./download_broadcast.sh",resources_url])
process = subprocess.Popen(command, cwd=cwd, stdout=subprocess.PIPE, shell=True)
output, error = process.communicate()
if process.returncode == 0:
print("Command executed successfully!")
print("Output:\n", output.decode())
else:
print("Error executing command:", error.decode())
def helloworld():
print("helloworld")
if __name__ == "__main__":
download()

View File

@@ -0,0 +1,17 @@
import os,sys
import requests
def send_message(webhook_url, message):
data = {
'content': message
}
response = requests.post(webhook_url, json=data)
if response.status_code == 204:
print('Message sent successfully.')
else:
print('Failed to send message.')
# webhook_url = 'https://discord.com/api/webhooks/1188733135014350858/WMbHoxDuepmiJOifvIzMfxMzBF3AYTOEo9OaEM7QKFIj9sj0SeXnUOQd-rMO6KFMiirl'
# message = "Hello, Discord!"
# send_message(webhook_url, message)

View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -ex
rm -rf *.part *.ytdl
sleep 1
if pgrep -x "yt-dlp" > /dev/null; then
echo "Process is running."
else
echo "Process is not running."
yt-dlp $1
# yt-dlp https://twitter.com/i/broadcasts/1OyKAWRYeOgJb
fi
mv *.mp4 ../_downloaded/

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -ex
# ./download_space.sh https://twitter.com/i/spaces/1LyGBnmdpejGN
# twspace_dl -v -i $1 -c cookies.txt -u master_url.txt
# https://x.com/i/spaces/1kvJpvwyBvQKE
if pgrep -x "twspace_dl" > /dev/null; then
echo "Process is running."
else
echo "Process is not running."
# twspace_dl -v -i https://twitter.com/i/spaces/1BdxYrLqVwNKX -c cookies.txt
twspace_dl -v -i $1 -c cookies.txt
fi
mv *.m4a ../_downloaded/

View File

@@ -0,0 +1,17 @@
import subprocess
import os,sys
def download_space(space_url="https://twitter.com/i/spaces/1LyGBnmdpejGN" ):
cwd = os.path.dirname(__file__)
command = ' '.join(["./download_space.sh",space_url])
process = subprocess.Popen(command, cwd=cwd, stdout=subprocess.PIPE, shell=True)
output, error = process.communicate()
if process.returncode == 0:
print("Command executed successfully!")
print("Output:\n", output.decode())
else:
print("Error executing command:", error.decode())
def helloworld():
print("helloworld")

View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -ex
yt-dlp https://twitter.com/i/broadcasts/1OyKAWRWROgJb

View File

@@ -0,0 +1,2 @@
file '/src/download/tmp1tjxl9pd/(louis)f-1OyKAWRLDkbJb.m4a'
file '/src/download/tmp1tjxl9pd/(louis)f-1OyKAWRLDkbJb_new.m4a'

View File

@@ -0,0 +1,2 @@
file '/src/download/tmpeubq7koa/(louis)-1yoKMwgoZeXJQ.m4a'
file '/src/download/tmpeubq7koa/(louis)-1yoKMwgoZeXJQ_new.m4a'