admin管理员组文章数量:1391937
I'm trying to view old community posts that I remember but youtube limits how much community posts load. It happens on all channels. The community posts aren't deleted. If you have the links you can still get to the posts for example but besides that you can't get to older community posts.
I can also see a problem with archiving and lost media if some youtube posts don't get saved.
I tried using some Community Post Scraper to archive such as but they didn't work pass 200 community posts I tried using python and java code with youtube api to try to see if I can retrieve youtube community posts with trying to find the urls but nothing worked If anyone can find a solution please let me know.
I was able to get this working for videos but not community posts.
import requests
api_key = "insert"
base_url = ";
def youtube_search(query, max_results=10):
params = {
"part": "snippet",
"q": query,
"type": "video",
"maxResults": max_results,
"key": api_key
}
response = requests.get(base_url, params=params)
if response.status_code == 200:
results = response.json()
videos = []
for item in results.get("items", []):
video_data = {
"title": item["snippet"]["title"],
"channel": item["snippet"]["channelTitle"],
"video_url": f"={item['id']['videoId']}"
}
videos.append(video_data)
return videos
else:
print("Error:", response.status_code, response.text)
return []
search_query = "Python programming tutorials"
search_results = youtube_search(search_query)
for idx, video in enumerate(search_results, start=1):
print(f"{idx}. {video['title']} (by {video['channel']})")
print(f" Watch here: {video['video_url']}")
本文标签: pythonHow can I see search or view youtube community posts older than 200Stack Overflow
版权声明:本文标题:python - How can I see search or view youtube community posts older than 200? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744729454a2621958.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论