Adding my public gpg key.

Moving upload destination input out of drop Segment.

Disabling uploads when downloads are disabled.

Inverting labels for checkboxes in inverted modal.

Deleting file_groups which no longer contain the exclusive primary path.

Adding debug logging for all API errors.

Checking that upload output is not a directory.

Expanding nginx request size.

Adding docs to upload endpoint.

Using dot-circle icon for more image mimetypes.

Using Form.Field to make upload destination required.

Adding border to inverted Segments.

Many files can be uploaded in chunks.

Files can be uploaded, progress is displayed.

Showing white border around share QR code.

Displaying WROLPi colors for download icons.

Creating button to clear DirectorySearch.

Excluding channel/domain directories so other directories can be returned.

Ordering search results.

Ignoring when no channel is found only if we have a destination.

Limiting directory search results.

Displaying categories when searching destination directories.

Handling when live_chat.json file exists.

Allowing refresh of directory directly.

Logging which download was successful.

Removing timeout.

Creating index for directory names.

Sleeping to catch cancel.

Arbitrary files can be downloaded using the new FileDownloader.
This commit is contained in:
Roland 2023-04-18 22:03:45 -06:00
parent 83f9f6f085
commit 387282b445
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
45 changed files with 1665 additions and 356 deletions

View file

@ -53,7 +53,6 @@ class ArchiveDownloader(Downloader, ABC):
return archives
# Archive downloader is the last downloader which should be used.
archive_downloader = ArchiveDownloader()

View file

@ -11,6 +11,7 @@ from typing import Optional, Tuple, List
from bs4 import BeautifulSoup
from selenium import webdriver
from sqlalchemy import asc
from sqlalchemy.orm import Session
from modules.archive.models import Domain, Archive
@ -440,3 +441,13 @@ def search_archives(search_str: str, domain: str, limit: int, offset: int, order
results, total = handle_file_group_search_results(stmt, params)
return results, total
@optional_session
def search_domains_by_directory(name: str, limit: int = 5, session: Session = None) -> List[Domain]:
domains = session.query(Domain) \
.filter(Domain.directory.ilike(f'%{name}%')) \
.order_by(asc(Domain.domain)) \
.limit(limit) \
.all()
return domains

View file

@ -127,7 +127,7 @@ class InventoriesConfig(ConfigFile):
self.update({'version': value})
INVENTORIES_CONFIG: InventoriesConfig = InventoriesConfig(global_=True)
INVENTORIES_CONFIG: InventoriesConfig = InventoriesConfig()
TEST_INVENTORIES_CONFIG: InventoriesConfig = None

View file

@ -1,6 +1,8 @@
import pathlib
from pathlib import Path
from typing import List, Dict, Union
from sqlalchemy import asc
from sqlalchemy.orm import Session
from sqlalchemy.orm.exc import NoResultFound
@ -194,3 +196,13 @@ def download_channel(id_: int):
raise InvalidDownload(f'Channel {channel.name} does not have a download!')
download.renew(reset_attempts=True)
session.commit()
@optional_session
def search_channels_by_directory(name: str, limit: int = 5, session: Session = None) -> List[Channel]:
channels = session.query(Channel) \
.filter(Channel.directory.ilike(f'%{name}%')) \
.order_by(asc(Channel.name)) \
.limit(limit) \
.all()
return channels

View file

@ -208,8 +208,13 @@ class VideoDownloader(Downloader, ABC):
if not channel and (local_channel_id or channel_url or destination):
# Could not find channel via yt-dlp info_json, use info from ChannelDownloader if it created this Download.
logger.info(f'Using download.settings to find channel')
channel = get_channel(channel_id=local_channel_id, url=channel_url, directory=destination,
return_dict=False)
try:
channel = get_channel(channel_id=local_channel_id, url=channel_url, directory=destination,
return_dict=False)
except UnknownChannel:
# We do not need a Channel if we have a destination directory.
if not destination:
raise
if channel:
found_channel = 'download_settings'
@ -297,8 +302,10 @@ class VideoDownloader(Downloader, ABC):
session.commit()
if download.settings and (tag_names := download.settings.get('tag_names')):
existing_names = video.file_group.tag_names
for name in tag_names:
video.add_tag(name)
if name not in existing_names:
video.add_tag(name)
except UnrecoverableDownloadError:
raise

View file

@ -211,7 +211,7 @@ class ChannelsConfig(ConfigFile):
self.update({'favorites': value})
CHANNELS_CONFIG: ChannelsConfig = ChannelsConfig(global_=True)
CHANNELS_CONFIG: ChannelsConfig = ChannelsConfig()
TEST_CHANNELS_CONFIG: ChannelsConfig = None
@ -328,7 +328,7 @@ class VideoDownloaderConfig(ConfigFile):
self.update({'youtube_include_dash_manifest': value})
VIDEO_DOWNLOADER_CONFIG: VideoDownloaderConfig = VideoDownloaderConfig(global_=True)
VIDEO_DOWNLOADER_CONFIG: VideoDownloaderConfig = VideoDownloaderConfig()
TEST_VIDEO_DOWNLOADER_CONFIG: VideoDownloaderConfig = None