mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-02-23 16:19:49 -05:00
fix needs_browsing check
correctly handle relative url "location" response header
This commit is contained in:
parent
bf5401283e
commit
ba8d5a3740
@ -37,6 +37,7 @@ import urlcanon
|
||||
from requests.structures import CaseInsensitiveDict
|
||||
import rethinkdb as r
|
||||
import datetime
|
||||
import urllib.parse
|
||||
|
||||
class ExtraHeaderAdder(urllib.request.BaseHandler):
|
||||
def __init__(self, extra_headers):
|
||||
@ -87,7 +88,9 @@ class YoutubeDLSpy(urllib.request.BaseHandler):
|
||||
|
||||
final_url = url
|
||||
while final_url in redirects:
|
||||
final_url = redirects.pop(final_url)['response_headers']['location']
|
||||
txn = redirects.pop(final_url)
|
||||
final_url = urllib.parse.urljoin(
|
||||
txn['url'], txn['response_headers']['location'])
|
||||
|
||||
final_bounces = []
|
||||
for txn in self.transactions:
|
||||
|
Loading…
x
Reference in New Issue
Block a user