Commit 2c2771d8 authored by Luca Braun's avatar Luca Braun

Started work on upload-script

parent c3a32399
import requests
import json
videoListUrl = "https://dev758755.vialog.app/Videos/Meta/ListAll"
videoUrl = "https://dev758755.vialog.app/stat/events?type=video&id="
videosRequest = requests.get(videoListUrl)
test = set()
if (videosRequest.status_code != 200):
print(f"Status: {videosRequest.status_code}")
for video in videosRequest.json():
id = video["videoId"]
videoRequest = requests.get(f"{videoUrl}{id}")
if videoRequest.status_code != 200:
print(f"Status: {videoRequest.status_code}")
if videoRequest.text != "":
historyList = sorted(videoRequest.json()[0]["History"], key=lambda k: k['moderationDate'], reversed=True)
i = 0
changeList = []
for eventMap in historyList:
if i == 0:
lastState = videoRequest.json()[0]["History"][0]
if eventMap["eventName"] == 'r1eabcbdc8f5378b2ba71a1b6fe2038b Created' or eventMap["eventName"] == 'Created':
change = {"changeType": "Created", "changedValue": "video_state", "previousValue": "", "newValue":"Created"}
print(change)
elif eventMap["eventName"] == "Restore":
change = {"changeType": "Restore", "changedValue": "", "previousValue": "", "newValue":""}
print(eventMap)
#change = {"changeType": "Restore", "changedValue": ""}
elif eventMap["eventName"] == "PositionChange":
change = {"changeType": "PositionChange", "changedValue": "position", "previousValue": eventMap["position"], "newValue":""}
print(eventMap)
elif eventMap["eventName"] == "Hide":
print(eventMap)
elif eventMap["eventName"] == "Publish":
print(eventMap)
elif eventMap["eventName"] == "CMNote":
print(eventMap)
elif eventMap["eventName"] == "Move":
print(eventMap)
elif eventMap["eventName"] == "VideoType":
print(eventMap)
elif eventMap["eventName"] == "Delete":
print(eventMap)
elif eventMap["eventName"] == "Copy":
print(eventMap)
elif eventMap["eventName"] == "CustomLabel":
print(eventMap)
i += 1
print(test)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment