Bug#956805: stretch-pu: package megatools/1.9.98-1+deb9u1
Package: release.debian.org
Severity: normal
Tags: stretch
User: release.debian.org@packages.debian.org
Usertags: pu
Hi,
megatools can be used (among other things) to download files from the
Mega cloud storage service.
Files can be downloaded using a link that contains a file handle and
an encryption key.
The format of these links has changed recently and megatools 1.9.98
doesn't recognize them.
This upload includes a simple patch (already committed upstream) to
add support for these new links.
Debdiff attached.
Berto
P.S: a similar upload is proposed for buster (#956801).
-- System Information:
Debian Release: 10.3
APT prefers stable
APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.19.0-8-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8), LANGUAGE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru megatools-1.9.98/debian/changelog megatools-1.9.98/debian/changelog
--- megatools-1.9.98/debian/changelog 2016-11-03 15:02:16.000000000 +0100
+++ megatools-1.9.98/debian/changelog 2020-04-15 14:28:54.000000000 +0200
@@ -1,3 +1,10 @@
+megatools (1.9.98-1+deb9u1) stretch; urgency=medium
+
+ * debian/patches/support-new-links.patch:
+ - Add support for the new format of mega.nz links.
+
+ -- Alberto Garcia <berto@igalia.com> Wed, 15 Apr 2020 14:28:54 +0200
+
megatools (1.9.98-1) unstable; urgency=medium
* New upstream release (Closes: #828434, #838651).
diff -Nru megatools-1.9.98/debian/patches/series megatools-1.9.98/debian/patches/series
--- megatools-1.9.98/debian/patches/series 2016-11-03 15:02:16.000000000 +0100
+++ megatools-1.9.98/debian/patches/series 2020-04-15 14:28:54.000000000 +0200
@@ -1 +1,2 @@
make-verbose.patch
+support-new-links.patch
diff -Nru megatools-1.9.98/debian/patches/support-new-links.patch megatools-1.9.98/debian/patches/support-new-links.patch
--- megatools-1.9.98/debian/patches/support-new-links.patch 1970-01-01 01:00:00.000000000 +0100
+++ megatools-1.9.98/debian/patches/support-new-links.patch 2020-04-15 14:28:54.000000000 +0200
@@ -0,0 +1,49 @@
+From: Alberto Garcia <berto@igalia.com>
+Subject: Support new format of mega.nz links
+Origin: https://megous.com/git/megatools/commit/?id=5d04a6203a231e8a3ea19bd1f203faee88e4b3a9
+Index: megatools/tools/dl.c
+===================================================================
+--- megatools.orig/tools/dl.c
++++ megatools/tools/dl.c
+@@ -145,6 +145,7 @@ int main(int ac, char* av[])
+ {
+ gc_error_free GError *local_err = NULL;
+ gc_regex_unref GRegex *file_regex = NULL, *folder_regex = NULL;
++ gc_regex_unref GRegex *file_regex2 = NULL, *folder_regex2 = NULL;;
+ gint i;
+ int status = 0;
+
+@@ -179,9 +180,15 @@ int main(int ac, char* av[])
+ file_regex = g_regex_new("^https?://mega(?:\\.co)?\\.nz/#!([a-z0-9_-]{8})!([a-z0-9_-]{43})$", G_REGEX_CASELESS, 0, NULL);
+ g_assert(file_regex != NULL);
+
++ file_regex2 = g_regex_new("^https?://mega\\.nz/file/([a-z0-9_-]{8})#([a-z0-9_-]{43})$", G_REGEX_CASELESS, 0, NULL);
++ g_assert(file_regex2 != NULL);
++
+ folder_regex = g_regex_new("^https?://mega(?:\\.co)?\\.nz/#F!([a-z0-9_-]{8})!([a-z0-9_-]{22})$", G_REGEX_CASELESS, 0, NULL);
+ g_assert(folder_regex != NULL);
+
++ folder_regex2 = g_regex_new("^https?://mega\\.nz/folder/([a-z0-9_-]{8})#([a-z0-9_-]{22})$", G_REGEX_CASELESS, 0, NULL);
++ g_assert(folder_regex2 != NULL);
++
+ // create session
+
+ s = tool_start_session(0);
+@@ -197,7 +204,7 @@ int main(int ac, char* av[])
+ gc_free gchar* handle = NULL;
+ gc_free gchar* link = tool_convert_filename(av[i], FALSE);
+
+- if (g_regex_match(file_regex, link, 0, &m1))
++ if (g_regex_match(file_regex, link, 0, &m1) || g_regex_match(file_regex2, link, 0, &m1))
+ {
+ handle = g_match_info_fetch(m1, 1);
+ key = g_match_info_fetch(m1, 2);
+@@ -219,7 +226,7 @@ int main(int ac, char* av[])
+ g_print("%s\n", cur_file);
+ }
+ }
+- else if (g_regex_match(folder_regex, link, 0, &m2))
++ else if (g_regex_match(folder_regex, link, 0, &m2) || g_regex_match(folder_regex2, link, 0, &m2))
+ {
+ if (opt_stream)
+ {
Reply to: