update,
This commit is contained in:
20
jason78989/project/src/download/broadcast.py
Normal file
20
jason78989/project/src/download/broadcast.py
Normal 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()
|
17
jason78989/project/src/download/discord.py
Normal file
17
jason78989/project/src/download/discord.py
Normal 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)
|
16
jason78989/project/src/download/download_broadcast.sh
Normal file
16
jason78989/project/src/download/download_broadcast.sh
Normal 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/
|
19
jason78989/project/src/download/download_space.sh
Normal file
19
jason78989/project/src/download/download_space.sh
Normal 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/
|
17
jason78989/project/src/download/space.py
Normal file
17
jason78989/project/src/download/space.py
Normal 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")
|
5
jason78989/project/src/download/test_download_live.sh
Normal file
5
jason78989/project/src/download/test_download_live.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
|
||||
yt-dlp https://twitter.com/i/broadcasts/1OyKAWRWROgJb
|
2
jason78989/project/src/download/tmp1tjxl9pd/list.txt
Normal file
2
jason78989/project/src/download/tmp1tjxl9pd/list.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
file '/src/download/tmp1tjxl9pd/(louis)f-1OyKAWRLDkbJb.m4a'
|
||||
file '/src/download/tmp1tjxl9pd/(louis)f-1OyKAWRLDkbJb_new.m4a'
|
2
jason78989/project/src/download/tmpeubq7koa/list.txt
Normal file
2
jason78989/project/src/download/tmpeubq7koa/list.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
file '/src/download/tmpeubq7koa/(louis)-1yoKMwgoZeXJQ.m4a'
|
||||
file '/src/download/tmpeubq7koa/(louis)-1yoKMwgoZeXJQ_new.m4a'
|
Reference in New Issue
Block a user