change URL for incremental and add the beginning of the new album downloader
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 6m9s

This commit is contained in:
pierre geeraert
2025-12-02 22:23:40 +00:00
parent 3d0b87998d
commit 31e72f28b0
5 changed files with 333 additions and 16 deletions
+4 -2
View File
@@ -63,9 +63,11 @@ urlpatterns = [
path('stash/', stashview.home), path('stash/', stashview.home),
path('stash/hello/', stashapp.hello), path('stash/hello/', stashapp.hello),
path('stash/form/', stashapp.form), path('stash/form/', stashapp.form),
path('stash/fapello/', stashapp.fapello), path('stash/incremental/', stashapp.incremental),
path('stash/album/', stashapp.album),
path('stash/album-form/', stashapp.album_form, name='submit_form'),
path('stash/submit-form/', stashapp.handle_survey_form, name='submit_form'), path('stash/submit-form/', stashapp.handle_survey_form, name='submit_form'),
path('stash/fapello-form/', stashapp.fapello_form, name='submit_form'), path('stash/incremental-form/', stashapp.incremental_form, name='submit_form'),
# path('bookstack/', docker_connection.apps.hello), # path('bookstack/', docker_connection.apps.hello),
+32 -4
View File
@@ -7,6 +7,8 @@ from django.core.files import File
from kubernetes import client, config from kubernetes import client, config
from celery import shared_task from celery import shared_task
from lxml import html
import requests
import os import os
import time import time
import random import random
@@ -14,6 +16,7 @@ import mimetypes
import ruamel.yaml import ruamel.yaml
import yaml import yaml
from urllib import request as urlrequest from urllib import request as urlrequest
from urllib import parse as urlparse
proxy_url = 'http://gluetun-svc.gluetun.svc:8888' proxy_url = 'http://gluetun-svc.gluetun.svc:8888'
proxy = urlrequest.ProxyHandler({ proxy = urlrequest.ProxyHandler({
@@ -27,12 +30,37 @@ def hello(request):
return HttpResponse('<h1>Hello stash!</h1>') return HttpResponse('<h1>Hello stash!</h1>')
def form(request): def form(request):
return render(request, 'stash_form.html',{}) return render(request, 'stash_form.html',{})
def album(request):
return render(request, 'album_form.html',{})
def fapello(request): def album_form(request):
return render(request, 'fapello_form.html',{}) name = request.GET.get('name')
url = request.GET.get('url')
external_galleries = request.GET.get('external_galleries')
def fapello_form(request): album_downloader(name=name,url=url,external_galleries=external_galleries)
#stash_folder = "/tmp/stash"
text_generated = "successfully sent to the album downloader"
return HttpResponse(text_generated, content_type="text/plain")
def album_downloader(name,url,external_galleries):
print(name+" "+url+" "+external_galleries)
req = urlrequest.Request(url)
urlcurl = urlrequest.urlopen(req).read()
page = requests.get(url)
webpage = html.fromstring(page.content)
print(webpage.xpath('//a/@href'))
#grep "https://www.pornpics.com/galleries/"
return 0
def incremental(request):
return render(request, 'incremental_form.html',{})
def incremental_form(request):
name = request.GET.get('name') name = request.GET.get('name')
url = request.GET.get('url') url = request.GET.get('url')
url_suffix = request.GET.get('url_suffix') url_suffix = request.GET.get('url_suffix')
@@ -0,0 +1,288 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Stash form</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
@charset "UTF-8";
.m-b-xs {
margin-bottom: 2%;
}
.m-b-md {
margin-bottom: 10%;
}
.m-t-xs {
margin-top: 2%;
}
.m-t-sm {
margin-top: 5%;
}
* {
outline: 0 !important;
}
body {
padding: 2% 0;
background-color: #37404a;
}
h1 {
font-family: "Roboto", sans-serif;
font-size: 2.2em;
font-weight: 300;
color: #85ffc7;
text-transform: uppercase;
}
p {
font-family: "Roboto", sans-serif;
font-size: 1.1em;
font-weight: 300;
color: #fff;
}
a {
color: #fff;
}
a:hover {
text-decoration: none;
color: #fff;
}
#survey-form label,
#survey-form .labels {
display: block;
margin-bottom: 2%;
font-family: "Roboto", sans-serif;
font-size: 1.1em;
font-weight: 300;
color: #fff;
letter-spacing: 0.5px;
}
#survey-form input::-webkit-input-placeholder {
color: transparent !important;
}
#survey-form input::-moz-placeholder {
color: transparent !important;
}
#survey-form input:-ms-input-placeholder {
color: transparent !important;
}
#survey-form input:-moz-placeholder {
color: transparent !important;
}
#survey-form input,
#survey-form select {
display: block;
width: 100%;
overflow: hidden;
outline: none;
border: 2px solid #333;
}
#survey-form input {
margin-top: 1.5%;
padding: 0 0 5px 0;
background: transparent;
border: none;
outline: none;
border-bottom: 2px solid #fff;
font-size: 1.1em;
font-weight: 300;
color: #85ffc7;
}
#survey-form input:focus {
border-color: #85ffc7;
}
#survey-form [type=checkbox],
#survey-form [type=radio] {
display: inline-block;
width: auto;
margin: 0px 10px 0 0;
}
#survey-form [type=checkbox],
#survey-form [type=radio] {
display: inline-block;
margin: 0 10px 0 0 !important;
position: relative;
top: 5px;
right: 0;
bottom: 0;
left: 0;
-webkit-appearance: none;
-moz-appearance: none;
-o-appearance: none;
appearance: none;
height: 23px;
width: 23px;
transition: all 0.15s ease-out 0s;
background: #37404a;
color: #fff;
cursor: pointer;
outline: none;
z-index: 1000;
border: 1px solid #fff;
}
#survey-form [type=checkbox]:hover,
#survey-form [type=radio]:hover {
border-color: #85ffc7;
}
#survey-form [type=checkbox]:checked:before,
#survey-form [type=radio]:checked:before {
display: inline-block;
height: 21px;
width: 21px;
position: relative;
left: 0;
bottom: 0;
content: "";
text-align: center;
font-family: "Glyphicons Halflings";
line-height: 20px;
font-size: 15px;
color: #85ffc7;
}
#survey-form [type=checkbox]:focus,
#survey-form [type=radio]:focus {
outline: none;
border-color: #fff;
}
#survey-form [type=radio] {
border-radius: 50%;
}
#survey-form [type=radio]:after {
border-radius: 50%;
}
#survey-form [type=number] {
width: 45px;
}
#survey-form [type=number]::-webkit-inner-spin-button, #survey-form [type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
margin: 0;
}
#survey-form select {
height: 40px;
padding-left: 5px;
background-color: #37404a;
border: 2px solid #fff;
color: #85ffc7;
}
#survey-form select option {
padding: 5px 10px;
font-weight: 300;
cursor: pointer;
}
#survey-form select option:hover {
background-color: #85ffc7;
}
#survey-form textarea {
resize: none;
margin-top: 2%;
padding: 10px 10px 0px 20px;
width: 100%;
height: 90px;
color: #85ffc7;
background-color: #37404a;
border: 2px solid #fff;
}
#survey-form .btn {
display: inline-block;
position: relative;
width: 100%;
margin: 3% 0 0 0;
height: 45px;
text-transform: uppercase;
text-decoration: none;
cursor: pointer;
border: 3px solid #85ffc7;
border-radius: 0;
font-weight: 500;
font-size: 1.2em;
color: #85ffc7;
text-align: center;
background: none;
transition: color 0.25s ease;
}
#survey-form .btn:after {
position: absolute;
content: "";
top: 0;
left: 0;
width: 0;
height: 100%;
background-color: #85ffc7;
transform-origin: left;
transition: width 0.5s ease;
z-index: -1;
}
#survey-form .btn:hover {
color: #37404a;
}
#survey-form .btn:hover:after {
width: 100%;
}
#survey-form fieldset {
margin: 5% 0 0 0;
}
.copyright {
text-align: center;
font-size: 10px;
color: #fff;
}
.copyright i {
color: #ef5350;
}
@media only screen and (max-width: 600px) {
body {
padding: 8% 0;
}
}
</style>
</head>
<main id="main" class="container">
<div class="row">
<div class="col-xs-12 col-lg-offset-3 col-lg-6">
<div class="m-b-md text-center">
<h1 id="title">Stash Form</h1>
<p id="description" class="description" class="text-center">Download form</p>
</div>
<form method="GET" action="/stash/album-form/" id="survey-form" name="survey-form">
<fieldset>
<label for="name" id="name-label">
Name *
<input class="" type="text" id="name" name="name" placeholder="Enter your name (required)" required />
</label>
</fieldset>
<fieldset>
<label for="url" id="url-label">
URL *
<input class="" type="url" id="url" name="url" placeholder="Enter the URL (required)" required />
</label>
</fieldset>
<fieldset>
<label for="external_galleries">
Any external galleries ?
<textarea id="external_galleries" name="external_galleries" ></textarea>
</label>
</fieldset>
<button id="submit" type="submit" class="btn">Submit the form</button>
</form>
</div>
</div>
</main>
</html>
@@ -256,10 +256,10 @@
<div class="row"> <div class="row">
<div class="col-xs-12 col-lg-offset-3 col-lg-6"> <div class="col-xs-12 col-lg-offset-3 col-lg-6">
<div class="m-b-md text-center"> <div class="m-b-md text-center">
<h1 id="title">fapello Form</h1> <h1 id="title">Incremental Form</h1>
<p id="description" class="description" class="text-center">Download form</p> <p id="description" class="description" class="text-center">Download form</p>
</div> </div>
<form method="GET" action="/stash/fapello-form/" id="survey-form" name="survey-form"> <form method="GET" action="/stash/incremental-form/" id="survey-form" name="survey-form">
<fieldset> <fieldset>
<label for="name" id="name-label"> <label for="name" id="name-label">
@@ -10852,7 +10852,7 @@
<li class="nav-item dropdown"> <li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="navbarDropdown" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Technologies</a> <a class="nav-link dropdown-toggle" id="navbarDropdown" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">Technologies</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown"> <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="/stash/fapello/">Incremental</a></li> <li><a class="dropdown-item" href="/stash/incremental/">Incremental</a></li>
<li><hr class="dropdown-divider" /></li> <li><hr class="dropdown-divider" /></li>
<li><a class="dropdown-item" href="#!">Album</a></li> <li><a class="dropdown-item" href="#!">Album</a></li>
</ul> </ul>
@@ -10887,7 +10887,7 @@
</div> </div>
<!-- Product actions--> <!-- Product actions-->
<div class="card-footer p-4 pt-0 border-top-0 bg-transparent"> <div class="card-footer p-4 pt-0 border-top-0 bg-transparent">
<div class="text-center"><a class="btn btn-outline-dark mt-auto" href="/stash/fapello/">Visit</a></div> <div class="text-center"><a class="btn btn-outline-dark mt-auto" href="/stash/incremental/">Visit</a></div>
</div> </div>
</div> </div>
</div> </div>
@@ -10908,7 +10908,7 @@
</div> </div>
<!-- Product actions--> <!-- Product actions-->
<div class="card-footer p-4 pt-0 border-top-0 bg-transparent"> <div class="card-footer p-4 pt-0 border-top-0 bg-transparent">
<div class="text-center"><a class="btn btn-outline-dark mt-auto" href="/stash/fapello/">Visit</a></div> <div class="text-center"><a class="btn btn-outline-dark mt-auto" href="/stash/incremental/">Visit</a></div>
</div> </div>
</div> </div>
</div> </div>
@@ -10917,20 +10917,19 @@
<!-- Sale badge--> <!-- Sale badge-->
<div class="badge bg-dark text-white position-absolute" style="top: 0.5rem; right: 0.5rem">Sale</div> <div class="badge bg-dark text-white position-absolute" style="top: 0.5rem; right: 0.5rem">Sale</div>
<!-- Product image--> <!-- Product image-->
<img class="card-img-top" src="https://dummyimage.com/450x300/dee2e6/6c757d.jpg" alt="..." /> <img class="card-img-top" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTUHI8m7S7bMhMC2WldjOFV4e9pjeK0m9asEw&s" alt="..." />
<!-- Product details--> <!-- Product details-->
<div class="card-body p-4"> <div class="card-body p-4">
<div class="text-center"> <div class="text-center">
<!-- Product name--> <!-- Product name-->
<h5 class="fw-bolder">Sale Item</h5> <h5 class="fw-bolder">Pornpics</h5>
<!-- Product price--> <!-- Product price-->
<span class="text-muted text-decoration-line-through">$50.00</span> https://www.pornpics.de/
$25.00
</div> </div>
</div> </div>
<!-- Product actions--> <!-- Product actions-->
<div class="card-footer p-4 pt-0 border-top-0 bg-transparent"> <div class="card-footer p-4 pt-0 border-top-0 bg-transparent">
<div class="text-center"><a class="btn btn-outline-dark mt-auto" href="#">Add to cart</a></div> <div class="text-center"><a class="btn btn-outline-dark mt-auto" href="/stash/album/">Visit</a></div>
</div> </div>
</div> </div>
</div> </div>