mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-03 17:39:42 +02:00
36 lines
919 B
Python
36 lines
919 B
Python
import json
|
|
|
|
def split_data(data):
|
|
p_json = json.loads(data)
|
|
|
|
count = p_json["count"]
|
|
posts = p_json["data"]
|
|
query = p_json["query"]
|
|
success = p_json["success"]
|
|
cached = p_json["cached"]
|
|
|
|
return count, posts, query, success, cached
|
|
|
|
def format_data(data):
|
|
post_author = [post["author"] for post in data]
|
|
post_titles = [post["title"] for post in data]
|
|
post_links = [post["url"] for post in data]
|
|
post_seeders = [post["seeders"] for post in data]
|
|
post_leechers = [post["leechers"] for post in data]
|
|
|
|
return post_titles, post_links, post_author, post_seeders, post_leechers
|
|
|
|
def format_data_minimal(data):
|
|
post_author = [post["author"] for post in data]
|
|
post_titles = [post["title"] for post in data]
|
|
post_links = [post["url"] for post in data]
|
|
|
|
return post_author, post_titles, post_links
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# https://open.spotify.com/track/0F0fMcIdL2FmcC9eYqwazX
|