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:
@@ -3,3 +3,4 @@
|
|||||||
venv/*
|
venv/*
|
||||||
*__pycache__*
|
*__pycache__*
|
||||||
Webcal-python/*
|
Webcal-python/*
|
||||||
|
.idea/*
|
||||||
|
|||||||
@@ -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',{})
|
||||||
|
|||||||
@@ -13,3 +13,4 @@ celery
|
|||||||
redis
|
redis
|
||||||
lxml
|
lxml
|
||||||
requests
|
requests
|
||||||
|
json
|
||||||
Reference in New Issue
Block a user