-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schedule script error #5
Comments
I'm not sure if I've fixed it properly or not. but I hacked the dizque-python lib to get this working. I also tweaked the sample script. The main issue seems to be in the merging of dictionaries resulting in an incomplete request to create the time slot. https://github.com/johndolljr/dizqueTV-python/tree/timeSlot |
It seems to be giving me an error when I add more timeslots and when I use type 'show'. I am using a schedule like:
|
Please make a pull request so I can test and merge |
$ python schedule_creator.py
Could not get any episodes to select for 00:00.
Could not get a program to schedule for 00:00.
Traceback (most recent call last):
File "schedule_creator.py", line 134, in
if channel.add_schedule(time_slots=time_slots, slots=[]):
File "C:\Python38\lib\site-packages\dizqueTV\decorators.py", line 19, in inner
return func(obj, **kwargs)
File "C:\Python38\lib\site-packages\dizqueTV\channels.py", line 797, in add_schedule
return self._dizque_instance._make_schedule(channel=self, schedule=schedule)
File "C:\Python38\lib\site-packages\dizqueTV\dizquetv.py", line 575, in _make_schedule
res = self._post(endpoint='/channel-tools/time-slots', data=data)
File "C:\Python38\lib\site-packages\dizqueTV\dizquetv.py", line 173, in post
return requests.post(url=url,
File "C:\Python38\lib\site-packages\dizqueTV\dizquetv_requests.py", line 35, in post
res = requests.post(url=url, json=data, headers=headers, timeout=timeout)
File "C:\Python38\lib\site-packages\requests\api.py", line 119, in post
return request('post', url, data=data, json=json, **kwargs)
File "C:\Python38\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Python38\lib\site-packages\requests\sessions.py", line 516, in request
prep = self.prepare_request(req)
File "C:\Python38\lib\site-packages\requests\sessions.py", line 449, in prepare_request
p.prepare(
File "C:\Python38\lib\site-packages\requests\models.py", line 317, in prepare
self.prepare_body(data, files, json)
File "C:\Python38\lib\site-packages\requests\models.py", line 467, in prepare_body
body = complexjson.dumps(json)
File "C:\Python38\lib\json_init.py", line 231, in dumps
return _default_encoder.encode(obj)
File "C:\Python38\lib\json\encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "C:\Python38\lib\json\encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "C:\Python38\lib\json\encoder.py", line 179, in default
raise TypeError(f'Object of type {o.class.name} '
TypeError: Object of type type is not JSON serializable
The text was updated successfully, but these errors were encountered: