put the steps for a reddit downloader
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 5m1s

This commit is contained in:
pierre geeraert
2025-12-04 22:59:15 +00:00
parent cd274aea81
commit a3ee639d77
3 changed files with 13 additions and 0 deletions
+1
View File
@@ -3,3 +3,4 @@
venv/* venv/*
*__pycache__* *__pycache__*
Webcal-python/* Webcal-python/*
.idea/*
+11
View File
@@ -10,6 +10,7 @@ from celery import shared_task
from lxml import html from lxml import html
import requests import requests
import os import os
import json
import time import time
import random import random
import mimetypes import mimetypes
@@ -137,7 +138,17 @@ def individual_image_downloader(image_url, filename ):
print("Still Can't download "+filename+" -- "+image_url+" == Cancelling") print("Still Can't download "+filename+" -- "+image_url+" == Cancelling")
return 0 return 0
def reddit_downloader(username):
url = "https://www.reddit.com/user/"+username+"/submitted/.json?limit=1000"
opener = urlrequest.build_opener(proxy)
urlrequest.install_opener(opener)
req = urlrequest.Request(url)
urlcurl = urlrequest.urlopen(req).read()
data = json.loads(urlcurl)
print(data['data']['children'][0]['data']['url'])
print(data['data']['children'][3]['data']['url'])
return 0
def incremental(request): def incremental(request):
return render(request, 'incremental_form.html',{}) return render(request, 'incremental_form.html',{})
+1
View File
@@ -13,3 +13,4 @@ celery
redis redis
lxml lxml
requests requests
json