mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Trimming video file name to avoid error when file name is too long.
This commit is contained in:
parent
37ff1ab2cd
commit
cdc73d9d16
13 changed files with 140 additions and 27 deletions
|
|
@ -2,7 +2,8 @@ from http import HTTPStatus
|
|||
from typing import List
|
||||
|
||||
from modules.zim import lib
|
||||
from wrolpi.common import logger, aiohttp_get, get_download_info, download_file, background_task, get_html_soup
|
||||
from wrolpi.common import logger, aiohttp_get, get_download_info, download_file, background_task, get_html_soup, \
|
||||
trim_file_name
|
||||
from wrolpi.downloader import Downloader, Download, DownloadResult
|
||||
|
||||
__all__ = ['KiwixCatalogDownloader', 'KiwixZimDownloader', 'kiwix_zim_downloader', 'kiwix_catalog_downloader']
|
||||
|
|
@ -72,7 +73,8 @@ class KiwixZimDownloader(Downloader):
|
|||
|
||||
zim_directory = lib.get_zim_directory()
|
||||
zim_directory.mkdir(parents=True, exist_ok=True)
|
||||
output_path = zim_directory / f'{download_info.name}'
|
||||
name = trim_file_name(download_info.name)
|
||||
output_path = zim_directory / name
|
||||
|
||||
if output_path.is_file():
|
||||
output_size = output_path.stat().st_size
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue