toolforge / video2commons

Transfer video and audio from external sites to Commons.
https://video2commons.toolforge.org/
GNU General Public License v3.0
44 stars 24 forks source link

Error: Cannot write playlist metadata to JSON file `/dev/null.info.json` #211

Closed DaxServer closed 3 months ago

DaxServer commented 3 months ago

Hi.

I tried to check if YouTube playlist could be processed: https://www.youtube.com/playlist?list=UUwx7Y3W30N8aS_tiCy2x-2g

Traceback (most recent call last):
  File "/data/project/video2commons/www/python/venv/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 4280, in _write_info_json
    write_json_file(self.sanitize_info(ie_result, self.params.get('clean_infojson', True)), infofn)
  File "/data/project/video2commons/www/python/venv/lib/python3.11/site-packages/yt_dlp/utils/_utils.py", line 192, in write_json_file
    tf = tempfile.NamedTemporaryFile(
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/tempfile.py", line 702, in NamedTemporaryFile
    file = _io.open(dir, mode, buffering=buffering,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/tempfile.py", line 699, in opener
    fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/tempfile.py", line 395, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/dev/null.info.json.cckjqehp.tmp'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/project/video2commons/www/python/venv/lib/python3.11/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/project/video2commons/www/python/venv/lib/python3.11/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/project/video2commons/www/python/src/../../../video2commons/frontend/api.py", line 272, in extract_url
    return jsonify(**do_extract_url(url))
                     ^^^^^^^^^^^^^^^^^^^
  File "/data/project/video2commons/www/python/src/../../../video2commons/frontend/urlextract.py", line 91, in do_extract_url
    info = yt_dlp.YoutubeDL(params).extract_info(url, download=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/project/video2commons/www/python/venv/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1615, in extract_info
    return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/project/video2commons/www/python/venv/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1626, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/project/video2commons/www/python/venv/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1782, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/project/video2commons/www/python/venv/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1911, in process_ie_result
    return self.__process_playlist(ie_result, download)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/project/video2commons/www/python/venv/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 2003, in __process_playlist
    _infojson_written = self._write_info_json(
                        ^^^^^^^^^^^^^^^^^^^^^^
  File "/data/project/video2commons/www/python/venv/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 4283, in _write_info_json
    self.report_error(f'Cannot write {label} metadata to JSON file {infofn}')
  File "/data/project/video2commons/www/python/venv/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1092, in report_error
    self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
  File "/data/project/video2commons/www/python/venv/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1031, in trouble
    raise DownloadError(message, exc_info)
yt_dlp.utils.DownloadError: ERROR: Cannot write playlist metadata to JSON file /dev/null.info.json
don-vip commented 3 months ago

Was it working before the update? AFAIK video2commons is designed to upload a single video per request.

don-vip commented 3 months ago

I don't think video2commons is designed to handle a playlist, sorry. Feel free to reopen the ticket if I'm wrong.