You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The video was uploaded successfully, and the thumbnail was successfully created and assigned, but something went wrong during the thumbnail assignment.
What I Did
Crashed on line 83 of my script, where I call WistiaApi.update_video(vidid, thumbnail_media_id=tn.hashed_id).
Traceback (most recent call last):
File "D:\Python\tvid.py", line 83, in <module>
WistiaApi.update_video(vidid, thumbnail_media_id=tn.hashed_id)
File "C:\Python311\Lib\site-packages\wystia\api_data.py", line 347, in update_video
return cls.update_media(
^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\wystia\api_data.py", line 396, in update_media
return model_cls.from_dict(r.json())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\dataclass_wizard\loaders.py", line 536, in fromdict
return load(d)
^^^^^^^
File "C:\Python311\Lib\site-packages\dataclass_wizard\loaders.py", line 611, in cls_fromdict
field_name = lookup_field_for_json_key(o, json_key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\dataclass_wizard\loaders.py", line 705, in lookup_field_for_json_key
raise e from None
dataclass_wizard.errors.UnknownJSONKey: A JSON key is missing from the dataclass schema for class `Video`.
unknown key: 'tags'
dataclass fields: ['hashed_id', 'id', 'name', 'type', 'created', 'updated', 'duration', 'status', 'description', 'progress', 'thumbnail', 'project', 'embed_code', 'assets', 'section', 'archived', 'has_audio_description', 'captions_enabled', 'overlay_text', 'caption_duration', 'num_captions', 'ad_disabled']
input JSON object: {"id": 113495448, "name": "Blep", "type": "Video", "archived": false, "created": "2023-12-22T19:27:51+00:00", "updated": "2023-12-22T19:27:52+00:00", "duration": 1583.04, "hashed_id": "d8wh65z917", "description": "", "progress": 0.14285714285714285, "status": "queued", "thumbnail": {"url": "https://embed-ssl.wistia.com/deliveries/955004dbcdfd7aef4f136c28c495f0df.jpg?image_crop_resized=200x120&video_still_time=791", "width": 200, "height": 120}, "tags": []}
Appears to be the same kind of problem as issue #59.
The text was updated successfully, but these errors were encountered:
Hi @KaneDM , thanks for opening this issue. I have to create a scheduled job that runs to make API requests, and then create an issue or attempt to fix code if there are any missing fields that are encountered.. this is on my bucket list for now.
In the meantime, can you try setting env variable RAISE_ON_UNKNOWN_KEY to false or 0, as shown in below file. Let me know if that helps for now.
Appreciate the update. Thankfully, for my particular use case, it wasn't affecting any of the actual operations of the script (it even does what it's supposed to do on that line, just crashes after). I wrapped that part of the script in a try/except to catch the error and it's currently running fine.
If you want me to try your proposed solution for testing purposes, let me know and I can do that.
Not confident enough in setting env variables to know if I did that right, but if I go to line 26 of the file you linked and change True to False , the error does go away.
Description
Crashed while running my Wistia upload/HTML dump script, which has worked previously. Code here:
https://github.com/KaneDM/wistia-upload-embed/blob/main/tvid.py
The video was uploaded successfully, and the thumbnail was successfully created and assigned, but something went wrong during the thumbnail assignment.
What I Did
Crashed on line 83 of my script, where I call
WistiaApi.update_video(vidid, thumbnail_media_id=tn.hashed_id)
.Appears to be the same kind of problem as issue #59.
The text was updated successfully, but these errors were encountered: