use
add_header Access-Control-Allow-Origin '*' always;
TO ADD A 'ALLOW ALL' Header on your response
like this:
server {
server_name hw5.onic.xyz;
location / {
add_header Access-Control-Allow-Origin '*' always;
proxy_pass http://127.0.0.1:6666;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Content-Type 'application/json';
}
listen 80;
}
Offical and popular instructions never told u.
python > 3.6
ffmpeg
curl -i -H "Content-Type: application/json" -X POST -d '{"keyword":"book"}' http://hw5.onic.xyz/
{
"uuid": "3f3d3fb0-b175-4a58-b8ec-9923813d0505",
"get_status": "http://hw5.onic.xyz/status/3f3d3fb0-b175-4a58-b8ec-9923813d0505",
"get_video": "http://hw5.onic.xyz/video/3f3d3fb0-b175-4a58-b8ec-9923813d0505"
}
curl -i -X GET http://hw5.onic.xyz/status/3f3d3fb0-b175-4a58-b8ec-9923813d0505
{
"uuid": "3f3d3fb0-b175-4a58-b8ec-9923813d0505",
"percentage": -1,
"status": "finished/doesnt exist"
}
curl -i -X GET http://hw5.onic.xyz/video/3f3d3fb0-b175-4a58-b8ec-9923813d0505
file it self
git clone http://github.com/BUEC500C1/video-PupilTong.git
cd video-PupilTong
pip3 install -r requirements.txt
python3 rest.py
Keys should be stores in 'key file:
[auth]
consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = ""
This module is able to convert a tuple of texts and a tuple of images' url to a summary video.
One task of the work load pool
Name | Description | type |
---|---|---|
directory | Output video storage directory | str |
text | List of texts | tuple |
img | Images list for each text. Program will use the first as the background | tuple |
keyword | keyword of this task, will use this to create a temp directory. Program will try to delete the directory first | str |
video processing core
Name | Description | type |
---|---|---|
item | the task to be added to the workload pool | ququeItem |
return a unique uuid of this task.
Check current task status.
type: int
# 0 - unstart
# 1~99 - processing
# 100 - finished
# -1 - deleted
This module is able to pull tweets from twitter with provided parmeters and prepare data for Module ffmpegQueue
Name | Description | type |
---|---|---|
consumer_key | twitter api key | str |
consumer_secret | twitter api key | str |
access_token | twitter api key | str |
access_token_secret | twitter api key | str |
keywords | List of hashtags | tuple |
directory | video storage directory | str |
item | number of photos for each hashtag to be converted | str |
Start the process