-import * as magnetUtil from 'magnet-uri'
-import * as parseTorrent from 'parse-torrent'
+import { decode } from 'magnet-uri'
+import parseTorrent, { Instance } from 'parse-torrent'
import { ServerConfigManager } from '@server/lib/server-config-manager'
import { setVideoTags } from '@server/lib/video'
import { FilteredModelAttributes } from '@server/types'
import { ServerConfigManager } from '@server/lib/server-config-manager'
import { setVideoTags } from '@server/lib/video'
import { FilteredModelAttributes } from '@server/types'
// Process video thumbnail from url if processing from request.files failed
if (!thumbnailModel && youtubeDLInfo.thumbnailUrl) {
// Process video thumbnail from url if processing from request.files failed
if (!thumbnailModel && youtubeDLInfo.thumbnailUrl) {
- thumbnailModel = await processThumbnailFromUrl(youtubeDLInfo.thumbnailUrl, video)
+ try {
+ thumbnailModel = await processThumbnailFromUrl(youtubeDLInfo.thumbnailUrl, video)
+ } catch (err) {
+ logger.warn('Cannot process thumbnail %s from youtubedl.', youtubeDLInfo.thumbnailUrl, { err })
+ }
// Process video preview from url if processing from request.files failed
if (!previewModel && youtubeDLInfo.thumbnailUrl) {
// Process video preview from url if processing from request.files failed
if (!previewModel && youtubeDLInfo.thumbnailUrl) {
- previewModel = await processPreviewFromUrl(youtubeDLInfo.thumbnailUrl, video)
+ try {
+ previewModel = await processPreviewFromUrl(youtubeDLInfo.thumbnailUrl, video)
+ } catch (err) {
+ logger.warn('Cannot process preview %s from youtubedl.', youtubeDLInfo.thumbnailUrl, { err })
+ }
// Create job to import the video
const payload = {
type: 'youtube-dl' as 'youtube-dl',
videoImportId: videoImport.id,
// Create job to import the video
const payload = {
type: 'youtube-dl' as 'youtube-dl',
videoImportId: videoImport.id,