From acf00c723f6729be8e6d881c9e8045c48dd24864 Mon Sep 17 00:00:00 2001 From: Safihre Date: Mon, 26 Apr 2021 23:31:54 +0200 Subject: [PATCH] Remove all xmlns from NZB-file data https://forums.sabnzbd.org/viewtopic.php?f=2&t=25342 --- sabnzbd/nzbparser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sabnzbd/nzbparser.py b/sabnzbd/nzbparser.py index 4e525b6..5c28c70 100644 --- a/sabnzbd/nzbparser.py +++ b/sabnzbd/nzbparser.py @@ -20,6 +20,7 @@ sabnzbd.nzbparser - Parse and import NZB files """ import bz2 import gzip +import re import time import logging import hashlib @@ -35,7 +36,7 @@ from sabnzbd.misc import name_to_cat def nzbfile_parser(raw_data, nzo): # Load data as file-object - raw_data = raw_data.replace("http://www.newzbin.com/DTD/2003/nzb", "", 1) + raw_data = re.sub(r"""\s(xmlns="[^"]+"|xmlns='[^']+')""", "", raw_data, count=1) nzb_tree = xml.etree.ElementTree.fromstring(raw_data) # Hash for dupe-checking