YoutubeDL-iOS
YoutubeDL-iOS copied to clipboard
App crashes with EXC_BAD_ACCESS during multiple downloads
I'm experiencing crashes when attempting to switch to a new YouTube video URL while another download is in progress.
Reproduction Steps:
- Enter a URL in the app
- Start downloading
- Enter another URL before the first download completes
Question:
How can I either:
- Cancel the previous download, or
- Switch to downloading the newer URL?
Additional Crash Log Info:
Y(6951,0x1fe0f4b40) malloc: nano zone abandoned due to inability to reserve vm space.
<__NSURLBackgroundSession: 0x10790ff40> created
void * _Nullable NSMapGet(NSMapTable * _Nonnull, const void * _Nullable): map table argument is NULL
startDownload(url:) https://www.youtube.com/watch?v=g-g6pc2BNcQ
download(url:) ["-f", "bestvideo+bestaudio[ext=m4a]/best", "--merge-output-format", "mp4", "--postprocessor-args", "Merger+ffmpeg:-c:v h264", "-o", "%(title).200B.%(ext)s", "--no-check-certificates", "https://www.youtube.com/watch?v=g-g6pc2BNcQ"]
<string>:1: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
2025-06-23 07:02:43 +0000 init(name:) took 1.0728836059570312e-06 seconds
2025-06-23 07:02:47 +0000 downloadPythonModule(from:) took 3.880484104156494 seconds
download(url:) info [youtube] Extracting URL: https://www.youtube.com/watch?v=g-g6pc2BNcQ
download(url:) info [youtube] g-g6pc2BNcQ: Downloading webpage
download(url:) info [youtube] g-g6pc2BNcQ: Downloading tv client config
download(url:) info [youtube] g-g6pc2BNcQ: Downloading player 9fe2e06e-main
download(url:) warning Writing cache to '/private/var/mobile/Containers/Data/Application/E45608F9-C017-4C5D-8A19-C7BDFA637269/.cache/yt-dlp/youtube-sts/9fe2e06e-main.json' failed: Traceback (most recent call last):
File "/var/mobile/Containers/Data/Application/E45608F9-C017-4C5D-8A19-C7BDFA637269/Library/Application Support/io.github.kewlbear.youtubedl-ios/yt_dlp/yt_dlp/cache.py", line 41, in store
os.makedirs(os.path.dirname(fn), exist_ok=True)
File "/var/containers/Bundle/Application/B6C8DE0E-98D6-4169-BB51-778E336C4AB8/Y.app/Python-iOS_PythonSupport.bundle/lib/python310.zip/os.py", line 215, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/var/containers/Bundle/Application/B6C8DE0E-98D6-4169-BB51-778E336C4AB8/Y.app/Python-iOS_PythonSupport.bundle/lib/python310.zip/os.py", line 215, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/var/containers/Bundle/Application/B6C8DE0E-98D6-4169-BB51-778E336C4AB8/Y.app/Python-iOS_PythonSupport.bundle/lib/python310.zip/os.py", line 225, in makedirs
mkdir(name, mode)
PermissionError: [Errno 1] Operation not permitted: '/private/var/mobile/Containers/Data/Application/E45608F9-C017-4C5D-8A19-C7BDFA637269/.cache'
download(url:) info [youtube] g-g6pc2BNcQ: Downloading tv player API JSON
download(url:) info [youtube] g-g6pc2BNcQ: Downloading ios player API JSON
download(url:) warning Writing cache to '/private/var/mobile/Containers/Data/Application/E45608F9-C017-4C5D-8A19-C7BDFA637269/.cache/yt-dlp/youtube-nsig/9fe2e06e-main.json' failed: Traceback (most recent call last):
File "/var/mobile/Containers/Data/Application/E45608F9-C017-4C5D-8A19-C7BDFA637269/Library/Application Support/io.github.kewlbear.youtubedl-ios/yt_dlp/yt_dlp/cache.py", line 41, in store
os.makedirs(os.path.dirname(fn), exist_ok=True)
File "/var/containers/Bundle/Application/B6C8DE0E-98D6-4169-BB51-778E336C4AB8/Y.app/Python-iOS_PythonSupport.bundle/lib/python310.zip/os.py", line 215, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/var/containers/Bundle/Application/B6C8DE0E-98D6-4169-BB51-778E336C4AB8/Y.app/Python-iOS_PythonSupport.bundle/lib/python310.zip/os.py", line 215, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/var/containers/Bundle/Application/B6C8DE0E-98D6-4169-BB51-778E336C4AB8/Y.app/Python-iOS_PythonSupport.bundle/lib/python310.zip/os.py", line 225, in makedirs
mkdir(name, mode)
PermissionError: [Errno 1] Operation not permitted: '/private/var/mobile/Containers/Data/Application/E45608F9-C017-4C5D-8A19-C7BDFA637269/.cache'
download(url:) info [youtube] g-g6pc2BNcQ: Downloading m3u8 information
download(url:) info [info] g-g6pc2BNcQ: Downloading 1 format(s): 616+140
Popen.__init__: <yt_dlp.utils.Popen object at 0x1365cce50> (['ffmpeg', '-bsfs'],)
Popen.communicate: <yt_dlp.utils.Popen object at 0x1365cce50> () {'timeout': None}
popenHandler [<yt_dlp.utils.Popen object at 0x1365cce50>, (['ffmpeg', '-bsfs'],)]
read(pipe:) Bitstream filters:
aac_adtstoasc
av1_frame_merge
av1_frame_split
av1_metadata
chomp
dump_extra
dca_core
dts2pts
dv_error_marker
eac3_core
extract_extradata
filter_units
h264_metadata
h264_mp4toannexb
h264_redundant_pps
hapqa_extract
hevc_metadata
hevc_mp4toannexb
imxdump
media100_to_mjpegb
mjpeg2jpeg
mjpegadump
mp3decomp
mpeg2_metadata
mpeg4_unpack_bframes
mov2textsub
noise
null
opus_metadata
pcm_rechunk
pgs_frame_merge
prores_metadata
remove_extra
setts
text2movsub
trace_headers
truehd_core
vp9_metadata
vp9_raw_reorder
vp9_superframe
vp9_superframe_split
read(pipe:)
HookMain: setjmp=0
ffmpeg version N-110285-ga3f49168dc Copyright (c) 2000-2023 the FFmpeg developers
built with Apple clang version 14.0.0 (clang-1400.0.29.202)
configuration: --prefix=/Users/changbeomahn/Projects/FFmpeg-iOS-Lame/tool/build/install/FFmpeg/arm64 --enable-cross-compile --disable-debug --disable-doc --enable-pic --disable-audiotoolbox --disable-sdl2 --disable-libxcb --target-os=darwin --arch=arm64 --cc='xcrun -sdk iphoneos clang' --as='gas-preprocessor.pl -arch aarch64 -- xcrun -sdk iphoneos clang' --extra-cflags='-arch arm64 -mios-version-min=13.0 -I/Users/changbeomahn/Projects/FFmpeg-iOS-Lame/tool/build/install/lame/arm64/include -L/Users/changbeomahn/Projects/FFmpeg-iOS-Lame/tool/build/install/lame/arm64/lib -I/Users/changbeomahn/Projects/FFmpeg-iOS-Lame/tool/build/install/FFmpeg/arm64/include' --extra-ldflags='-arch arm64 -mios-version-min=13.0 -I/Users/changbeomahn/Projects/FFmpeg-iOS-Lame/tool/build/install/lame/arm64/include -L/Users/changbeomahn/Projects/FFmpeg-iOS-Lame/tool/build/install/lame/arm64/lib -L/Users/changbeomahn/Projects/FFmpeg-iOS-Lame/tool/build/install/FFmpeg/arm64/lib' --enable-libmp3lame
libavutil 58. 6.100 / 58. 6.100
libavcodec 60. 9.100 / 60. 9.100
libavformat 60. 4.101 / 60. 4.101
libavdevice 60. 2.100 / 60. 2.100
libavfilter 9. 5.100 / 9. 5.100
libswscale 7. 2.100 / 7. 2.100
libswresample 4. 11.100 / 4. 11.100
FFmpeg_exit=0, will longjmp
HookMain: setjmp=1973
download(url:) info [hlsnative] Downloading m3u8 manifest
download(url:) info [hlsnative] Total fragments: 587
download(url:) info [download] Destination: [𝐏𝐥𝐚𝐲𝐥𝐢𝐬𝐭]90s Japanese Lofi 📼 Nostalgic Chill Vibes.f616.mp4
download(url:) info [download] 100.0% of ~ 712.00B at 342.10B/s ETA Unknown (frag 0/587)
download(url:) info [download] 0.1% of ~ 816.30KiB at 342.10B/s ETA Unknown (frag 1/587)
download(url:) info [download] 0.8% of ~ 204.07KiB at 614.27B/s ETA 02:45 (frag 1/587)
download(url:) info [download] 0.7% of ~ 497.57KiB at 614.27B/s ETA 02:45 (frag 1/587)
download(url:) info [download] 0.7% of ~ 1.06MiB at 614.27B/s ETA 02:45 (frag 1/587)
download(url:) info [download] 0.7% of ~ 2.21MiB at 614.27B/s ETA 02:45 (frag 1/587)
download(url:) info [download] 0.7% of ~ 4.50MiB at 6.96KiB/s ETA 02:50 (frag 1/587)
download(url:) info [download] 0.7% of ~ 9.08MiB at 16.96KiB/s ETA 02:56 (frag 1/587)
download(url:) info [download] 0.7% of ~ 18.26MiB at 33.90KiB/s ETA 03:03 (frag 1/587)
startDownload(url:) https://www.youtube.com/watch?v=g-g6pc2BNcQ
download(url:) ["-f", "bestvideo+bestaudio[ext=m4a]/best", "--merge-output-format", "mp4", "--postprocessor-args", "Merger+ffmpeg:-c:v h264", "-o", "%(title).200B.%(ext)s", "--no-check-certificates", "https://www.youtube.com/watch?v=g-g6pc2BNcQ"]
Can't show file for stack frame : <DBGLLDBStackFrame: 0x32b7346b0> - stackNumber:0 - name:_PyUnicode_FromId [inlined]. The file path does not exist on the file system: /Users/runner/work/Python-iOS/Python-iOS/kivy-ios/build/python3/arm64/Python-3.10.10/Include/internal/pycore_pystate.hwarning: Y.debug.dylib was compiled with optimization - stepping may behave oddly; variables may not be available.Can't show file for stack frame : <DBGLLDBStackFrame: 0x38566b3a0> - stackNumber:1 - name:_PyUnicode_FromId. The file path does not exist on the file system: /Users/runner/work/Python-iOS/Python-iOS/kivy-ios/build/python3/arm64/Python-3.10.10/Objects/unicodeobject.cCan't show file for stack frame : <DBGLLDBStackFrame: 0x38566b3a0> - stackNumber:1 - name:_PyUnicode_FromId. The file path does not exist on the file system: /Users/runner/work/Python-iOS/Python-iOS/kivy-ios/build/python3/arm64/Python-3.10.10/Objects/unicodeobject.cCan't show file for stack frame : <DBGLLDBStackFrame: 0x3856ba670> - stackNumber:2 - name:PyImport_Import. The file path does not exist on the file system: /Users/runner/work/Python-iOS/Python-iOS/kivy-ios/build/python3/arm64/Python-3.10.10/Python/import.cCan't show file for stack frame : <DBGLLDBStackFrame: 0x3856ba670> - stackNumber:2 - name:PyImport_Import. The file path does not exist on the file system: /Users/runner/work/Python-iOS/Python-iOS/kivy-ios/build/python3/arm64/Python-3.10.10/Python/import.cCan't show file for stack frame : <DBGLLDBStackFrame: 0x38566d1a0> - stackNumber:3 - name:PyImport_ImportModule. The file path does not exist on the file system: /Users/runner/work/Python-iOS/Python-iOS/kivy-ios/build/python3/arm64/Python-3.10.10/Python/import.cCan't show file for stack frame : <DBGLLDBStackFrame: 0x38566d1a0> - stackNumber:3 - name:PyImport_ImportModule. The file path does not exist on the file system: /Users/runner/work/Python-iOS/Python-iOS/kivy-ios/build/python3/arm64/Python-3.10.10/Python/import.c