Skip to content

Sharan-Babu/Vidtheta

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vidtheta

Utility, Tooling and Incentive for Theta Network (Video API) users & creators along with powerful Video Search.


Website: https://vidtheta.streamlit.app/

Project Info: https://devpost.com/software/vidtheta

The documentation website: Link was very helpful in implementing the project.

Other useful websites to refer:

Steps to run on Local Machine

carbon

Useful THETA video functions - Python

# -- Fetch URL
def create_presigned_url(id_key, secret_key):
    url = "https://api.thetavideoapi.com/upload"

    headers = {
        'x-tva-sa-id': id_key,
        'x-tva-sa-secret': secret_key,
    }

    response = requests.request("POST", url, headers=headers)

    return response.json()
# -- Upload video to presigned URL
def upload_video(presigned_url):
    headers = {
        'Content-Type': 'application/octet-stream'
    }

    with open("temp_video.mp4","rb") as f:
        data = f.read()

    response = requests.put(presigned_url, headers=headers, data = data)

    return response
# -- Transcode video
def transcode_video(id_key, secret_key, upload_id):
    url = "https://api.thetavideoapi.com/video"

    headers = {
    'x-tva-sa-id': id_key,
    'x-tva-sa-secret': secret_key,
    'Content-Type': 'application/json',
    }

    data = {
        "source_upload_id": upload_id,
        "playback_policy": "public",
    }

    response = requests.post(url, headers=headers, data=json.dumps(data))

    return response.json()["body"]["videos"][0]["id"]

About

Vidtheta: search utility for theta video api users

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages