bbsan2k / plugin.video.f1tv

Kodi Plugin for F1TV Streaming service
MIT License
59 stars 11 forks source link

Can't play live streams for Pre Season Testing #23

Closed mcapinha closed 4 years ago

mcapinha commented 4 years ago

I'm getting an exception when trying to play the live stream for the Pre Season Testing:

2020-02-26 17:07:06.730 T:1498497760   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.KeyError'>
                                            Error Contents: 'items'
                                            Traceback (most recent call last):
                                              File "/home/osmc/.kodi/addons/plugin.video.f1tv/main.py", line 14, in <module>
                                                plugin.run()
                                              File "/home/osmc/.kodi/addons/plugin.video.f1tv/resources/lib/plugin.py", line 575, in run
                                                router(sys.argv[2][1:])
                                              File "/home/osmc/.kodi/addons/plugin.video.f1tv/resources/lib/plugin.py", line 525, in router
                                                setContents(params['content_url'])
                                              File "/home/osmc/.kodi/addons/plugin.video.f1tv/resources/lib/plugin.py", line 132, in setContents
                                                asset = epi_data['items'][0]
                                            KeyError: 'items'
                                            -->End of Python script error report<--

I dumped the contents of epi_data and there's no items key. I'm glad to send a PR to fix this but can't really grasp which one is the correct url. I've tried several but none seem to load.

Here's the json dump of epi_data that I'm seeing:


item
{"archived": false, "uid": "sche_e8100062ef9b4f36aea9e4f55abddb2d", "schedule_urls": ["/api/schedules/sche_665198b1f164413db3199884d1ddb217/"], "self": "/api/sets/coll_bdb0023e6a1648b9a6d2ac1d02d599ad/items/sche_e8100062ef9b4f36aea9e4f55abddb2d/", "content_url": "/api/event-occurrence/even_ac137cd63ac045e1bdecf3956ff6056a/", "image_urls": [], "content_type": "event occurrence", "position": 1, "scheduled_item_modified": "2020-02-14T13:39:07.319534+00:00", "set_url": "/api/sets/coll_bdb0023e6a1648b9a6d2ac1d02d599ad/"}

epi_data
{"event_url": "/api/event/even_7019f303ce7e4360840791d79b1723e9/", "uid": "even_ac137cd63ac045e1bdecf3956ff6056a", "race_season_url": "/api/race-season/race_11cd5edd03404b6199bf4712efb34391/", "schedule_urls": ["/api/schedules/sche_fffd4d24e0c947a6a94d6d6a738f11fe/"], "winner_3_url": null, "official_name": "Pre-Season Testing 2020", "modified": "2020-02-14T12:58:15.114962+00:00", "sessionoccurrence_urls": ["/api/session-occurrence/sess_8aeeb18c623546d49c2a09a2fd6a0736/", "/api/session-occurrence/sess_7b0ceaced4c94e50941b2afbda3c19e3/", "/api/session-occurrence/sess_fff7b1bf909c416eb18e935976958b30/", "/api/session-occurrence/sess_08df12b695124e48b6b766af1743c203/", "/api/session-occurrence/sess_438ccd39d5084b9eac7c8ce5fc7bdbd9/", "/api/session-occurrence/sess_aa2481547df944a58d297405bedc47e0/", "/api/session-occurrence/sess_05af512d93c4489792f87c87338afc6f/", "/api/session-occurrence/sess_6c5a38e3da084d6f837d46fbe553a932/", "/api/session-occurrence/sess_47e1b2eaa2914b3e8cef33de6ee9e021/", "/api/session-occurrence/sess_6ed15e729d414e3cb7d3c50d9f70adf2/", "/api/session-occurrence/sess_7f0a67e46b6d419081a91e9940a6cfc8/", "/api/session-occurrence/sess_f777e8c0aca14cdeb50954e935e219fd/", "/api/session-occurrence/sess_3a4b97bb1ec2418f8920eb2b2a25f2a1/", "/api/session-occurrence/sess_81fa6f769fb04d81a2b8718719903720/"], "circuit_url": "/api/circuit/circ_e3eec4234bf84a348c8e517c658938b8/", "self": "/api/event-occurrence/even_ac137cd63ac045e1bdecf3956ff6056a/", "data_source_fields": [], "start_date": "2020-02-18", "data_source_id": "9998", "end_date": "2020-02-28", "driveroccurrence_urls": [], "image_urls": ["/api/images/imag_615af36ed1c2409283ca9272220da3b0/"], "slug": "pre-season-testing-2020", "last_data_ingest": "2020-02-26T17:24:19.399516+00:00", "winner_2_url": null, "name": "Pre-Season Testing 2020", "language": "en", "created": "2020-02-14T12:15:07.942638+00:00", "nation_url": "/api/nation/nati_d45741931fa742dfb82b6aed13b5d4e3/", "sponsor_url": "/api/sponsors/spon_696bb9e6b64340988307d854d9cfc49c/", "winner_1_url": null, "editability": "normal"}``` 
mcapinha commented 4 years ago

So i followed through this: I was under the impression that I would find the link to the live video under Sets > Grand Prix Weekend Live, but I was getting the error I pasted above. I worked my way around it, got the know the API a little bit and eventually got the videos to play. But to my dismay, what I find under Grand Prix Weekend Live are actually Tech Talk videos and not testing sessions.. So, either I took a wrong turn somewhere or the API results are not correct.

Any pointers on where the live link should be? If I know where it's at, I can probably create a PR to make this work.

mcapinha commented 4 years ago

Oh, nevermind. Just notice 0.1.2 was released and it works just fine!