Skip to content

misterdownloadmanager: The ultimate open-source, clean-room download manager written from scratch in pure Rust for Windows, Mac, and Linux

Add URL: YouTube playlists, Dailymotion's player address, and DAT from browsers (#396)

Ahmed Nefzaoui2f08aad45605
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fe365fcb..ed46fd98 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,12 +14,15 @@ Each release's notes on GitHub come from its section here (`## [X.Y.Z]`, see
- Windows: no more crash when a screen is unplugged, turned off or rearranged while MDM runs ([#335](https://github.com/anefzaoui/misterdownloadmanager/issues/335)).
### Added
+- **Far more file types taken from the browser by default** ([#382](https://github.com/anefzaoui/misterdownloadmanager/issues/382)): AI models and datasets (GGUF, SAFETENSORS, CKPT, PT, ONNX, PARQUET...), 3D and CAD (GLB, FBX, OBJ, STL, BLEND, STEP...), design and camera RAW files, ebooks, Office files, DAT, disk images and split archives. A list you never edited gains them; one you edited stays yours.
- **A Safari extension, inside the Mac app:** a click on a link to a file type MDM takes goes to MDM, and so do the right-click items, the button over videos and **Media on this page**, as in the other browsers. Safari gives extensions no access to its downloads, so a download a page starts by itself stays with Safari, and the browser's proxy is not shared. See [Browser integration](docs/browser-integration.md#safari-macos).
- **Far more file types taken from the browser by default** ([#382](https://github.com/anefzaoui/misterdownloadmanager/issues/382)): AI models and datasets (GGUF, SAFETENSORS, CKPT, PT, ONNX, PARQUET...), 3D and CAD (GLB, FBX, OBJ, STL, BLEND, STEP...), design and camera RAW files, ebooks, Office files, disk images and split archives. A list you never edited gains them; one you edited stays yours.
- Help: what to do when an antivirus or VirusTotal flags MDM, and how to check your copy is the real one.
### Fixed
+- **A YouTube playlist in Add URL** ([#338](https://github.com/anefzaoui/misterdownloadmanager/issues/338)) opens the video window with its videos, instead of saving the page as a file named "playlist".
+- **Dailymotion's embedded player** ([#359](https://github.com/anefzaoui/misterdownloadmanager/issues/359)): its address is looked up as the video's own page, so the download button works on sites that embed one.
- A download that a page starts by script (a thank-you page going to the installer, as obsproject.com's does) gets the file's address, not the page's, so MDM no longer saves that page under the installer's name ([#374](https://github.com/anefzaoui/misterdownloadmanager/issues/374)). A finished download also shows what really came down when the server gives no size.
- **Stop** on a download in a running queue stays stopped, instead of the queue starting it again a moment later; **Stop All** too ([#341](https://github.com/anefzaoui/misterdownloadmanager/issues/341)).
- Removing the last feed in the RSS feeds window no longer crashes the app ([#321](https://github.com/anefzaoui/misterdownloadmanager/issues/321)).
diff --git a/ROADMAP.md b/ROADMAP.md
index 2a8ab147..26ee0efe 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -125,6 +125,9 @@ Everything below ships together, in version 0.5.0.
- ✅ Far more file types taken by default: AI models and datasets, 3D and CAD, design and camera
RAW, ebooks, Office, disk images and split archives; a list never edited gains them
([#382](https://github.com/anefzaoui/misterdownloadmanager/issues/382))
+- ✅ Add URL: a YouTube playlist opens the video window; Dailymotion's embedded player is looked
+ up as the video's own page ([#338](https://github.com/anefzaoui/misterdownloadmanager/issues/338),
+ [#359](https://github.com/anefzaoui/misterdownloadmanager/issues/359))
- ✅ Windows: Download File Info and the progress window open in front of the browser, even when
Windows doesn't let MDM take the foreground; the keyboard stays where it was until a click
([#208](https://github.com/anefzaoui/misterdownloadmanager/issues/208))
diff --git a/crates/app/src/videodlg.rs b/crates/app/src/videodlg.rs
index 1f4494b6..482969f1 100644
--- a/crates/app/src/videodlg.rs
+++ b/crates/app/src/videodlg.rs
@@ -169,9 +169,10 @@ impl VideoDialog {
/// Opened for `page` (Add URL was given a video's page, or the browser's button was
/// clicked with `context`): looks it up at once.
pub fn for_page(folder: PathBuf, page: &str, context: mdm_ipc::Command) -> Self {
+ let page = mdm_tools::pages::video_address(page);
VideoDialog {
- page: page.to_owned(),
- from_browser: page.to_owned(),
+ page: page.clone(),
+ from_browser: page,
context,
auto_look: true,
..Self::new(folder)
@@ -516,6 +517,8 @@ impl VideoDialog {
&& can_look
&& let Some(tool) = &ytdlp
{
+ // A typed or pasted address too (#359); the box shows what is looked up.
+ self.page = mdm_tools::pages::video_address(self.page.trim());
let slot: Slot<Looked> = Arc::new(Mutex::new(None));
let (out, exe, page, ctx) = (
slot.clone(),
diff --git a/crates/ipc/src/capture.rs b/crates/ipc/src/capture.rs
index d5a033f5..3781d735 100644
--- a/crates/ipc/src/capture.rs
+++ b/crates/ipc/src/capture.rs
@@ -14,7 +14,7 @@ use serde::Deserialize;
/// gigabyte today (#382): AI models and datasets, 3D and CAD, camera RAW and design files, books
/// and Office files, disk images and split archives. Never what a browser saves as part of
/// everyday browsing (pages, scripts, plain text, web images) or installs itself (XPI, CRX).
-pub const DEFAULT_AUTO_TYPES: &str = "00* 3DM 3DS 3GP 3MF 7Z AAB AAC ABC ACE AFDESIGN AFPHOTO AI AIF AIFF APE APK APKM APKS APPIMAGE APPX APPXBUNDLE ARJ ARROW ARW ASF AU AVI AVRO AZW AZW3 BAK BAM BIN BLEND BZ BZ2 C4D CAB CAF CBR CBZ CCD CHD CKPT CPIO CR2 CR3 CRAM CSO DAE DCM DDS DEB DFF DIVX DJVU DMG DNG DOC DOCX DSF DWG DXF EPS EPUB EXE EXR F3D F4V FASTA FASTQ FB2 FBX FEATHER FIG FITS FLAC FLATPAK FQ GCODE GCZ GEM GGML GGUF GLB GLTF GPKG GRIB GRIB2 GZ GZIP H5 HDF5 HDR IGES IGS IMG INDD IPA ISO ISZ JAR JOBLIB JSONL KERAS KRA LAS LAZ LLAMAFILE LWO LZ LZ4 LZH LZMA M2T M2TS M2V M4A M4B M4V MA MAT MAX MB MBTILES MDF MDS MID MIDI MKA MKV MLMODEL MOBI MOV MP3 MP4 MPA MPE MPEG MPG MSI MSIX MSIXBUNDLE MSP MSU MTS MXF NC NDJSON NEF NEMO NII NPY NPZ NRG NSP NSZ NUPKG OBJ ODP ODS ODT OGG OGM OGV ONNX OPUS ORC ORF OTF OVA OVF PAK PARQUET PB PBF PDF PICKLE PK3 PK4 PKG PKL PLJ PLY POTX PPS PPSX PPT PPTX PSB PSD PT PTH QCOW QCOW2 QT R0* R1* R2* R3* R4* R5* R6* R7* R8* R9* RA RAF RAR RDS RM RMVB RPM RTF RUN RVZ RW2 SAFETENSORS SEA SF2 SFZ SHP SIT SITX SKETCH SKP SLDASM SLDPRT SNAP SQLITE SQLITE3 STEP STL STP TAR TBZ TBZ2 TFLITE TGA TGZ TIF TIFF TLZ TORRENT TTA TTC TTF TXZ TZST UNITYPACKAGE USD USDA USDC USDZ VDB VDI VHD VHDX VMDK VOB VPK VSIX WAV WBFS WEBM WHL WIM WMA WMV WRL WTV WUA WV X3D XAPK XCF XCI XLS XLSB XLSM XLSX XZ Z Z0* ZIP ZIPX ZPR ZST ZTL";
+pub const DEFAULT_AUTO_TYPES: &str = "00* 3DM 3DS 3GP 3MF 7Z AAB AAC ABC ACE AFDESIGN AFPHOTO AI AIF AIFF APE APK APKM APKS APPIMAGE APPX APPXBUNDLE ARJ ARROW ARW ASF AU AVI AVRO AZW AZW3 BAK BAM BIN BLEND BZ BZ2 C4D CAB CAF CBR CBZ CCD CHD CKPT CPIO CR2 CR3 CRAM CSO DAE DAT DCM DDS DEB DFF DIVX DJVU DMG DNG DOC DOCX DSF DWG DXF EPS EPUB EXE EXR F3D F4V FASTA FASTQ FB2 FBX FEATHER FIG FITS FLAC FLATPAK FQ GCODE GCZ GEM GGML GGUF GLB GLTF GPKG GRIB GRIB2 GZ GZIP H5 HDF5 HDR IGES IGS IMG INDD IPA ISO ISZ JAR JOBLIB JSONL KERAS KRA LAS LAZ LLAMAFILE LWO LZ LZ4 LZH LZMA M2T M2TS M2V M4A M4B M4V MA MAT MAX MB MBTILES MDF MDS MID MIDI MKA MKV MLMODEL MOBI MOV MP3 MP4 MPA MPE MPEG MPG MSI MSIX MSIXBUNDLE MSP MSU MTS MXF NC NDJSON NEF NEMO NII NPY NPZ NRG NSP NSZ NUPKG OBJ ODP ODS ODT OGG OGM OGV ONNX OPUS ORC ORF OTF OVA OVF PAK PARQUET PB PBF PDF PICKLE PK3 PK4 PKG PKL PLJ PLY POTX PPS PPSX PPT PPTX PSB PSD PT PTH QCOW QCOW2 QT R0* R1* R2* R3* R4* R5* R6* R7* R8* R9* RA RAF RAR RDS RM RMVB RPM RTF RUN RVZ RW2 SAFETENSORS SEA SF2 SFZ SHP SIT SITX SKETCH SKP SLDASM SLDPRT SNAP SQLITE SQLITE3 STEP STL STP TAR TBZ TBZ2 TFLITE TGA TGZ TIF TIFF TLZ TORRENT TTA TTC TTF TXZ TZST UNITYPACKAGE USD USDA USDC USDZ VDB VDI VHD VHDX VMDK VOB VPK VSIX WAV WBFS WEBM WHL WIM WMA WMV WRL WTV WUA WV X3D XAPK XCF XCI XLS XLSB XLSM XLSX XZ Z Z0* ZIP ZIPX ZPR ZST ZTL";
/// The lists earlier versions started with: IDM 6.42's (MDM 0.2.x), with TORRENT (#39), then
/// with today's packages and open formats (#208). A saved list equal to one of them was never edited, and becomes today's (`upgraded_types`).
@@ -660,6 +660,7 @@ mod tests {
"backup.7z.001",
"backup.z01",
"movie.r27",
+ "5GB-testfile.dat",
] {
assert!(r.auto_type(name), "{name}");
}
@@ -705,6 +706,7 @@ mod tests {
"jane.ma",
"site.ai",
"cover.psd",
+ "winmail.dat",
] {
assert!(!clipboard_type(DEFAULT_AUTO_TYPES, name), "{name}");
assert!(!clipboard_type("*", name), "{name}, a lone star");
diff --git a/crates/tools/src/pages.rs b/crates/tools/src/pages.rs
index f657338a..b3b70bad 100644
--- a/crates/tools/src/pages.rs
+++ b/crates/tools/src/pages.rs
@@ -25,12 +25,15 @@ pub fn is_video_page(url: &Url) -> bool {
match host {
"youtube.com" | "music.youtube.com" | "youtube-nocookie.com" => {
(path == "/watch" && query("v"))
+ // A playlist's own page: the video window lists its videos (#69, #338).
+ || (path == "/playlist" && query("list"))
|| matches!(segs.as_slice(), ["shorts" | "live" | "embed" | "v", _, ..])
}
"youtu.be" => segs.len() == 1,
"vimeo.com" => segs.iter().any(|s| s.chars().all(|c| c.is_ascii_digit())),
"player.vimeo.com" => matches!(segs.as_slice(), ["video", _, ..]),
"dailymotion.com" => matches!(segs.as_slice(), ["video", _, ..]),
+ "geo.dailymotion.com" => segs.first() == Some(&"player") && query("video"),
"dai.ly" => segs.len() == 1,
"twitch.tv" => matches!(segs.as_slice(), ["videos", _] | [_, "clip", _]),
"clips.twitch.tv" => segs.len() == 1,
@@ -53,6 +56,32 @@ pub fn is_video_page(url: &Url) -> bool {
}
}
+/// The address to give yt-dlp for a video page: Dailymotion's embedded player
+/// (`geo.dailymotion.com/player/<player>.html?video=<id>`, what a site embedding it shows) becomes
+/// the video's own page, which is the one that always lists its formats (#359). Any other address
+/// as it is.
+pub fn video_address(page: &str) -> String {
+ let id = Url::parse(page).ok().and_then(|url| {
+ let player = url
+ .host_str()
+ .is_some_and(|h| h.eq_ignore_ascii_case("geo.dailymotion.com"))
+ && url.path().starts_with("/player");
+ player
+ .then(|| {
+ url.query_pairs()
+ .find(|(k, _)| k == "video")
+ .map(|(_, v)| v.into_owned())
+ })
+ .flatten()
+ });
+ match id {
+ Some(id) if !id.is_empty() && id.chars().all(|c| c.is_ascii_alphanumeric()) => {
+ format!("https://www.dailymotion.com/video/{id}")
+ }
+ _ => page.to_owned(),
+ }
+}
+
/// Whether `url` is an image gallery's page on a site gallery-dl reads (#58): a Wikimedia
/// Commons category, a Flickr album or photographer, a DeviantArt or ArtStation gallery, an
/// Imgur album, a Pixiv artist or work, a Pinterest board, a Danbooru or Gelbooru search, a
@@ -156,6 +185,10 @@ mod tests {
assert!(page("https://youtu.be/Tg6byXUo8RU?si=x"));
assert!(page("https://vimeo.com/76979871"));
assert!(page("https://www.dailymotion.com/video/x8abcd"));
+ assert!(page(
+ "https://geo.dailymotion.com/player/x19jsm.html?video=k4lGbCpdJJFSQgMvE8W"
+ ));
+ assert!(page("https://www.youtube.com/playlist?list=PLS37ZBSRa46"));
assert!(page("https://www.twitch.tv/videos/123456"));
assert!(page(
"https://www.tiktok.com/@someone/video/7300000000000000000"
@@ -168,13 +201,33 @@ mod tests {
assert!(page("https://soundcloud.com/artist/track"));
}
+ #[test]
+ fn dailymotions_player_becomes_the_videos_own_page() {
+ assert_eq!(
+ video_address(
+ "https://geo.dailymotion.com/player/x19jsm.html?video=k4lGbCpdJJFSQgMvE8W"
+ ),
+ "https://www.dailymotion.com/video/k4lGbCpdJJFSQgMvE8W"
+ );
+ for same in [
+ "https://geo.dailymotion.com/player/x19jsm.html",
+ "https://geo.dailymotion.com/player/x19jsm.html?video=a/b",
+ "https://www.dailymotion.com/video/x8abcd",
+ "https://www.youtube.com/watch?v=x",
+ "not an address",
+ ] {
+ assert_eq!(video_address(same), same);
+ }
+ }
+
#[test]
fn other_pages_and_files_are_not() {
assert!(!page("https://www.youtube.com/"));
assert!(!page("https://www.youtube.com/watch"));
assert!(!page("https://www.youtube.com/@channel/videos"));
assert!(!page("https://www.youtube.com/results?search_query=x"));
- assert!(!page("https://www.youtube.com/playlist?list=PLx"));
+ assert!(!page("https://www.youtube.com/playlist"));
+ assert!(!page("https://geo.dailymotion.com/player/x19jsm.html"));
assert!(!page("https://vimeo.com/channels/staffpicks"));
assert!(!page("https://example.com/video.mp4"));
assert!(!page("https://x.com/someone"));
diff --git a/extension/background.js b/extension/background.js
index c3bcd6a3..10380de4 100644
--- a/extension/background.js
+++ b/extension/background.js
@@ -128,7 +128,7 @@ async function remoteSend(target, message) {
// The file types the app takes by default (mdm_ipc::capture::DEFAULT_AUTO_TYPES; a test keeps
// them the same): what is caught for another MDM when this computer has none to ask.
const DEFAULT_TYPES =
- "00* 3DM 3DS 3GP 3MF 7Z AAB AAC ABC ACE AFDESIGN AFPHOTO AI AIF AIFF APE APK APKM APKS APPIMAGE APPX APPXBUNDLE ARJ ARROW ARW ASF AU AVI AVRO AZW AZW3 BAK BAM BIN BLEND BZ BZ2 C4D CAB CAF CBR CBZ CCD CHD CKPT CPIO CR2 CR3 CRAM CSO DAE DCM DDS DEB DFF DIVX DJVU DMG DNG DOC DOCX DSF DWG DXF EPS EPUB EXE EXR F3D F4V FASTA FASTQ FB2 FBX FEATHER FIG FITS FLAC FLATPAK FQ GCODE GCZ GEM GGML GGUF GLB GLTF GPKG GRIB GRIB2 GZ GZIP H5 HDF5 HDR IGES IGS IMG INDD IPA ISO ISZ JAR JOBLIB JSONL KERAS KRA LAS LAZ LLAMAFILE LWO LZ LZ4 LZH LZMA M2T M2TS M2V M4A M4B M4V MA MAT MAX MB MBTILES MDF MDS MID MIDI MKA MKV MLMODEL MOBI MOV MP3 MP4 MPA MPE MPEG MPG MSI MSIX MSIXBUNDLE MSP MSU MTS MXF NC NDJSON NEF NEMO NII NPY NPZ NRG NSP NSZ NUPKG OBJ ODP ODS ODT OGG OGM OGV ONNX OPUS ORC ORF OTF OVA OVF PAK PARQUET PB PBF PDF PICKLE PK3 PK4 PKG PKL PLJ PLY POTX PPS PPSX PPT PPTX PSB PSD PT PTH QCOW QCOW2 QT R0* R1* R2* R3* R4* R5* R6* R7* R8* R9* RA RAF RAR RDS RM RMVB RPM RTF RUN RVZ RW2 SAFETENSORS SEA SF2 SFZ SHP SIT SITX SKETCH SKP SLDASM SLDPRT SNAP SQLITE SQLITE3 STEP STL STP TAR TBZ TBZ2 TFLITE TGA TGZ TIF TIFF TLZ TORRENT TTA TTC TTF TXZ TZST UNITYPACKAGE USD USDA USDC USDZ VDB VDI VHD VHDX VMDK VOB VPK VSIX WAV WBFS WEBM WHL WIM WMA WMV WRL WTV WUA WV X3D XAPK XCF XCI XLS XLSB XLSM XLSX XZ Z Z0* ZIP ZIPX ZPR ZST ZTL";
+ "00* 3DM 3DS 3GP 3MF 7Z AAB AAC ABC ACE AFDESIGN AFPHOTO AI AIF AIFF APE APK APKM APKS APPIMAGE APPX APPXBUNDLE ARJ ARROW ARW ASF AU AVI AVRO AZW AZW3 BAK BAM BIN BLEND BZ BZ2 C4D CAB CAF CBR CBZ CCD CHD CKPT CPIO CR2 CR3 CRAM CSO DAE DAT DCM DDS DEB DFF DIVX DJVU DMG DNG DOC DOCX DSF DWG DXF EPS EPUB EXE EXR F3D F4V FASTA FASTQ FB2 FBX FEATHER FIG FITS FLAC FLATPAK FQ GCODE GCZ GEM GGML GGUF GLB GLTF GPKG GRIB GRIB2 GZ GZIP H5 HDF5 HDR IGES IGS IMG INDD IPA ISO ISZ JAR JOBLIB JSONL KERAS KRA LAS LAZ LLAMAFILE LWO LZ LZ4 LZH LZMA M2T M2TS M2V M4A M4B M4V MA MAT MAX MB MBTILES MDF MDS MID MIDI MKA MKV MLMODEL MOBI MOV MP3 MP4 MPA MPE MPEG MPG MSI MSIX MSIXBUNDLE MSP MSU MTS MXF NC NDJSON NEF NEMO NII NPY NPZ NRG NSP NSZ NUPKG OBJ ODP ODS ODT OGG OGM OGV ONNX OPUS ORC ORF OTF OVA OVF PAK PARQUET PB PBF PDF PICKLE PK3 PK4 PKG PKL PLJ PLY POTX PPS PPSX PPT PPTX PSB PSD PT PTH QCOW QCOW2 QT R0* R1* R2* R3* R4* R5* R6* R7* R8* R9* RA RAF RAR RDS RM RMVB RPM RTF RUN RVZ RW2 SAFETENSORS SEA SF2 SFZ SHP SIT SITX SKETCH SKP SLDASM SLDPRT SNAP SQLITE SQLITE3 STEP STL STP TAR TBZ TBZ2 TFLITE TGA TGZ TIF TIFF TLZ TORRENT TTA TTC TTF TXZ TZST UNITYPACKAGE USD USDA USDC USDZ VDB VDI VHD VHDX VMDK VOB VPK VSIX WAV WBFS WEBM WHL WIM WMA WMV WRL WTV WUA WV X3D XAPK XCF XCI XLS XLSB XLSM XLSX XZ Z Z0* ZIP ZIPX ZPR ZST ZTL";
// Pair with the MDM at `address` with a code it shows; {ok} or {ok: false, why, left}.
async function remotePair(address, code) {