-
Bug
-
Resolution: Fixed
-
Normal
-
1.3.2
-
None
-
Windows 10 x64
In a plugin, let's say I download the page 'http://www.apage.com/path' using xmlws. If this page does a redirection to path '/redirect', Picard will attempt to load page '/redirect' instead of 'http://www.apage.com/redirect'.
I can reproduce this with any page on anidb.net that does a redirection.
To fix it, I added the following monkeypatch to my script (all pages have the string 'animedb.pl' in the path, so I use that to detect this bug).
if not hasattr(QUrl, 'orig_toString'): QUrl.orig_toString = QUrl.toString def qturl_toString_monkeypatch(self, options = QUrl.None): if 'animedb.pl' in self.path() and 'anidb.net' not in self.host(): log.debug("QUrl.toString Monkeypatch fired!") self.setHost('anidb.net') if 'perl-bin' not in self.path(): self.setPath('/perl-bin/%s' % self.path()) return QUrl.orig_toString(self, options) QUrl.toString = qturl_toString_monkeypatch
Of course, fixing this directly on the xmlws redirect handler would be better.