put the steps for a reddit downloader
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 5m1s
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 5m1s
This commit is contained in:
@@ -10,6 +10,7 @@ from celery import shared_task
|
||||
from lxml import html
|
||||
import requests
|
||||
import os
|
||||
import json
|
||||
import time
|
||||
import random
|
||||
import mimetypes
|
||||
@@ -137,7 +138,17 @@ def individual_image_downloader(image_url, filename ):
|
||||
print("Still Can't download "+filename+" -- "+image_url+" == Cancelling")
|
||||
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):
|
||||
return render(request, 'incremental_form.html',{})
|
||||
|
||||
Reference in New Issue
Block a user