tag_video.py 625 B

12345678910111213141516171819202122232425
  1. import requests
  2. import json
  3. class Tag:
  4. @classmethod
  5. def video_tag(cls, pq_id: str, tag: str):
  6. try:
  7. url = "https://admin.piaoquantv.com/manager/video/tag/addVideoTags"
  8. payload = json.dumps({
  9. "videoId": pq_id,
  10. "tagNames": tag
  11. })
  12. headers = {
  13. 'Content-Type': 'application/json'
  14. }
  15. response = requests.request("POST", url, headers=headers, data=payload)
  16. response = response.json()
  17. code = response['code']
  18. return code
  19. except:
  20. return 1