mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-14 07:04:27 -04:00
add gallerydl plugin
This commit is contained in:
parent
3421833830
commit
b6520243bc
11 changed files with 3888 additions and 0 deletions
78
archivebox/plugins/gallerydl/views.py
Normal file
78
archivebox/plugins/gallerydl/views.py
Normal file
|
@ -0,0 +1,78 @@
|
|||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from django.views import View
|
||||
from django.shortcuts import render
|
||||
from django.db.models import Q
|
||||
|
||||
from core.models import Snapshot
|
||||
|
||||
# from archivebox.config import PUBLIC_SNAPSHOTS
|
||||
PUBLIC_SNAPSHOTS = True
|
||||
|
||||
|
||||
class GalleryDLIconView(View):
|
||||
template_name = 'plugin_gallerydl__icon.html'
|
||||
|
||||
# render static html index from filesystem archive/<timestamp>/index.html
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
return {
|
||||
# **super().get_context_data(**kwargs),
|
||||
# 'VERSION': VERSION,
|
||||
# 'COMMIT_HASH': COMMIT_HASH,
|
||||
# 'FOOTER_INFO': FOOTER_INFO,
|
||||
}
|
||||
|
||||
|
||||
def get(self, request, path):
|
||||
if not request.user.is_authenticated and not PUBLIC_SNAPSHOTS:
|
||||
return redirect(f'/admin/login/?next={request.path}')
|
||||
|
||||
# ...
|
||||
return render(template_name=self.template_name, request=self.request, context=context)
|
||||
|
||||
|
||||
class GalleryDLEmbedView(View):
|
||||
template_name = 'plugin_gallerydl__embed.html'
|
||||
|
||||
# render static html index from filesystem archive/<timestamp>/index.html
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
return {
|
||||
# **super().get_context_data(**kwargs),
|
||||
# 'VERSION': VERSION,
|
||||
# 'COMMIT_HASH': COMMIT_HASH,
|
||||
# 'FOOTER_INFO': FOOTER_INFO,
|
||||
}
|
||||
|
||||
|
||||
def get(self, request, path):
|
||||
if not request.user.is_authenticated and not PUBLIC_SNAPSHOTS:
|
||||
return redirect(f'/admin/login/?next={request.path}')
|
||||
|
||||
# ...
|
||||
return render(template_name=self.template_name, request=self.request, context=context)
|
||||
|
||||
|
||||
class GalleryDLOutputView(View):
|
||||
template_name = 'plugin_gallerydl__output.html'
|
||||
|
||||
# render static html index from filesystem archive/<timestamp>/index.html
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
return {
|
||||
# **super().get_context_data(**kwargs),
|
||||
# 'VERSION': VERSION,
|
||||
# 'COMMIT_HASH': COMMIT_HASH,
|
||||
# 'FOOTER_INFO': FOOTER_INFO,
|
||||
}
|
||||
|
||||
|
||||
def get(self, request, path):
|
||||
if not request.user.is_authenticated and not PUBLIC_SNAPSHOTS:
|
||||
return redirect(f'/admin/login/?next={request.path}')
|
||||
|
||||
# ...
|
||||
return render(template_name=self.template_name, request=self.request, context=context)
|
Loading…
Add table
Add a link
Reference in a new issue