fix the add links form

This commit is contained in:
Nick Sweeting 2020-07-13 12:21:37 -04:00
parent 215d5eae32
commit ae208435c9
6 changed files with 10 additions and 8 deletions

View file

@ -191,7 +191,7 @@ def log_deduping_finished(num_new_links: int):
def log_crawl_started(new_links): def log_crawl_started(new_links):
print('{lightblue}[*] Starting crawl of {} sites 1 hop out from starting point{reset}'.format(len(new_links), **ANSI)) print('{lightred}[*] Starting crawl of {} sites 1 hop out from starting point{reset}'.format(len(new_links), **ANSI))
### Indexing Stage ### Indexing Stage

View file

@ -49,7 +49,7 @@ class SnapshotAdmin(admin.ModelAdmin):
'<a href="/{}/{}">📼 </a> ' '<a href="/{}/{}">📼 </a> '
'<a href="/{}/{}">📦 </a> ' '<a href="/{}/{}">📦 </a> '
'<a href="/{}/{}">🏛 </a> ' '<a href="/{}/{}">🏛 </a> '
'</span>' '</span><br/>'
'<a href="/{}">{}</a>', '<a href="/{}">{}</a>',
obj.archive_path, canon['wget_path'] or '', obj.archive_path, canon['wget_path'] or '',
obj.archive_path, canon['pdf_path'], obj.archive_path, canon['pdf_path'],

View file

@ -1,7 +1,10 @@
from django import forms from django import forms
CHOICES = (('url', 'URL'), ('feed', 'Feed')) CHOICES = (
('0', 'depth=0 (archive just this url)'),
('1', 'depth=1 (archive this url and all sites one link away)'),
)
class AddLinkForm(forms.Form): class AddLinkForm(forms.Form):
url = forms.URLField() url = forms.URLField()
source = forms.ChoiceField(choices=CHOICES, widget=forms.RadioSelect, initial='url') depth = forms.ChoiceField(choices=CHOICES, widget=forms.RadioSelect, initial='0')

View file

@ -66,9 +66,9 @@ class AddLinks(View):
if form.is_valid(): if form.is_valid():
url = form.cleaned_data["url"] url = form.cleaned_data["url"]
print(f'[+] Adding URL: {url}') print(f'[+] Adding URL: {url}')
depth = 0 if form.cleaned_data["source"] == "url" else 1 depth = 0 if form.cleaned_data["depth"] == "0" else 0
input_kwargs = { input_kwargs = {
"url": url, "urls": url,
"depth": depth, "depth": depth,
"update_all": False, "update_all": False,
"out_dir": OUTPUT_DIR, "out_dir": OUTPUT_DIR,

View file

@ -56,7 +56,6 @@ def save_git(link: Link, out_dir: Optional[str]=None, timeout: int=TIMEOUT) -> A
cmd = [ cmd = [
GIT_BINARY, GIT_BINARY,
'clone', 'clone',
# '--mirror',
'--recursive', '--recursive',
*([] if CHECK_SSL_VALIDITY else ['-c', 'http.sslVerify=false']), *([] if CHECK_SSL_VALIDITY else ['-c', 'http.sslVerify=false']),
without_query(without_fragment(link.url)), without_query(without_fragment(link.url)),

View file

@ -212,7 +212,7 @@
</form> </form>
</center> </center>
<a href="{% url 'admin:core_snapshot_changelist' %}">Go back to Snapshot list</a> <a href="{% url 'admin:core_snapshot_changelist' %}">Go back to Main Index</a>
</body> </body>
</html> </html>