Replies: 5 comments 2 replies
-
You can already get all this information from https://iptv-org.github.io/api/channels.json by channel ID. More details: https://github.com/iptv-org/api#channels |
Beta Was this translation helpful? Give feedback.
-
The API https://iptv-org.github.io/api/channels.json does not have the streaming url, the ideal would be to have a single Json with all the information |
Beta Was this translation helpful? Give feedback.
-
You could create a fusion of both JSONs using the channel ID, which would result in an unified JSON containing all the different datas that you could use. Using Python as an example, this would look like this : import json
# Load the JSON files
with open('streams.json', 'r') as file1:
data1 = json.load(file1)
with open('channels.json', 'r') as file2:
data2 = json.load(file2)
# Create a dictionary to store the merged data
merged_data = {}
# Merge the data based on the common key "id"
for item1 in data1:
id_value = item1['channel']
merged_data[id_value] = item1
for item2 in data2:
if item2['id'] == id_value:
merged_data[id_value].update(item2)
# Convert the merged dictionary back to a list
merged_list = list(merged_data.values())
# Write the merged data to a new JSON file
with open('merged_data.json', 'w') as merged_file:
json.dump(merged_list, merged_file, indent=4) |
Beta Was this translation helpful? Give feedback.
-
I was just a little confused because there weren't many details but thanks to your code I was able to do it, it worked excellently, thanks friend |
Beta Was this translation helpful? Give feedback.
-
when I try to use the endpoint at: https://iptv-org.github.io/api/streams.json I keep getting a list with practically all items having an empty "channel" field so I don't have any way to match this list with the one from: https://iptv-org.github.io/api/channels.json. Any idea of what I'm doing wrong? |
Beta Was this translation helpful? Give feedback.
-
In the Json that returns https://iptv-org.github.io/api/streams.json you should put the url of the image of the transmitted channel and the name of the channel that is transmitted, it would be more comfortable for everyone to have that information in that API, thanks!
Beta Was this translation helpful? Give feedback.
All reactions