Skip to content

Commit 137c212

Browse files
authored
[plugin.video.formula1] 2.0.4 (#4650)
1 parent 66e9585 commit 137c212

5 files changed

Lines changed: 14 additions & 16 deletions

File tree

plugin.video.formula1/addon.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<addon id="plugin.video.formula1" name="Formula 1" version="2.0.3" provider-name="jaylinski">
2+
<addon id="plugin.video.formula1" name="Formula 1" version="2.0.4" provider-name="jaylinski">
33
<requires>
44
<import addon="xbmc.python" version="3.0.0"/>
55
<import addon="script.module.requests" version="2.29.0"/>
@@ -16,7 +16,10 @@
1616
<forum>https://forum.kodi.tv/showthread.php?tid=352138</forum>
1717
<website>https://www.formula1.com</website>
1818
<source>https://github.com/jaylinski/kodi-addon-formula1</source>
19-
<news>2.0.3 (2024-12-22)
19+
<news>2.0.4 (2025-04-05)
20+
Fixed error when selecting the "Race results"-item in the "Standings"-section
21+
22+
2.0.3 (2024-12-22)
2023
Updated player API key
2124

2225
2.0.2 (2021-05-22)

plugin.video.formula1/resources/lib/f1/api.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import base64
21
import datetime
32
import time
43
import urllib.parse
@@ -18,18 +17,17 @@
1817
class Api:
1918
"""This class uses the Formula 1 v1 API."""
2019

21-
api_base_url = "https://api.formula1.com/v1/"
20+
api_base_url = "https://api.formula1.com"
2221
api_key = "RNoNDmjJGUFSu1Re9GfMVzJfDClaUV47" # Extracted from public Formula 1 Android App
2322
api_limit = 10
2423
api_date_format = "%Y-%m-%dT%H:%M:%S"
2524

2625
# API endpoints
27-
api_path_editorial = "editorial-assemblies/videos/2BiKQUC040cmuysoQsgwcK"
28-
api_path_videos = "video-assets/videos"
29-
api_path_constructors = "editorial-constructorlisting/listing"
30-
api_path_drivers = "editorial-driverlisting/listing"
31-
api_path_events = "editorial-eventlisting/events"
32-
api_path_results = "fom-results/raceresults"
26+
api_path_editorial = "/v1/editorial-assemblies/videos/2BiKQUC040cmuysoQsgwcK"
27+
api_path_videos = "/v1/video-assets/videos"
28+
api_path_constructors = "/v1/editorial-constructorlisting/listing"
29+
api_path_drivers = "/v1/editorial-driverlisting/listing"
30+
api_path_events = "/v1/editorial-eventlisting/events"
3331

3432
# Brightcove (https://www.brightcove.com/)
3533
# Policy key is hardcoded and was extracted from public Formula 1 Android App
@@ -141,9 +139,6 @@ def _map_json_to_collection(self, json_obj):
141139
elif "events" in json_obj:
142140
items = json_obj.get("events")
143141
item_type = "events"
144-
elif "raceresults" in json_obj:
145-
items = json_obj.get("raceresults")
146-
item_type = "events"
147142
elif "raceResultsRace" in json_obj:
148143
items = json_obj.get("raceResultsRace").get("results", [])
149144
item_type = "raceresult"

plugin.video.formula1/resources/lib/models/editorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def to_list_item(self, addon_base):
1515
})
1616
url = addon_base + "/?" + urllib.parse.urlencode({
1717
"action": "call",
18-
"call": "video-assets/videos?tag={tag}".format(tag=self.id),
18+
"call": "/v1/video-assets/videos?tag={tag}".format(tag=self.id),
1919
})
2020

2121
return url, list_item, True

plugin.video.formula1/resources/lib/models/event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def to_list_item(self, addon_base):
1616
})
1717
url = addon_base + "/?" + urllib.parse.urlencode({
1818
"action": "call",
19-
"call": "fom-results/race?meeting={id}".format(id=self.id)
19+
"call": "/v2/fom-results/race?meeting={id}".format(id=self.id)
2020
})
2121

2222
if self.info["hasEnded"]:

plugin.video.formula1/resources/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def run():
6565
xbmcplugin.addDirectoryItems(handle, items, len(items))
6666
xbmcplugin.endOfDirectory(handle)
6767
elif "results" in action:
68-
items = listItems.from_collection(api.standings(Api.api_path_results))
68+
items = listItems.from_collection(api.standings(Api.api_path_events))
6969
xbmcplugin.addDirectoryItems(handle, items, len(items))
7070
xbmcplugin.endOfDirectory(handle)
7171
else:

0 commit comments

Comments
 (0)