Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 1.3.2
    • Fix Version/s: 1.4
    • Component/s: Other
    • Labels:
      None
    • Environment:
      Windows 10 x64

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ruipgpinheiro Rui Pinheiro
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: