Formatted-RSS-to-Telegram/FR2T/parser.py
2021-05-27 20:40:18 +08:00

18 lines
295 B
Python

import feedparser
def rssParser(url: str, user_agent: str):
return feedparser.parse(url, agent=user_agent)["entries"]
def objParser(obj: dict, url: str):
paths = url.split(".")
for p in paths:
if p.isdigit():
p = int(p)
obj = obj[p]
return obj