Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synthesize warc using regular vs raw stream #71

Open
lesleyodu opened this issue Oct 1, 2022 · 3 comments
Open

Synthesize warc using regular vs raw stream #71

lesleyodu opened this issue Oct 1, 2022 · 3 comments

Comments

@lesleyodu
Copy link

The synthesize warc command will unintentionally switch back to the original stream instead of the raw stream. The bug seems to be resolved by making deep copies of all variables from the original stream.

Affected lines in hypercane/hypercane/synthesize/warcs.py:
76 - headers_list = copy.deepcopy(resp.raw.headers.items())
81 - warc_target_uri = str(resp.links[link]['url'])
88 - mdt = str(resp.headers['memento-datetime'])

@shawnmjones
Copy link
Member

Thank you for this. I'll fix it soon.

@lesleyodu
Copy link
Author

Update - Unfortunately I am seeing that hypercane is still switching streams for just some warcs even with these changes - will let you know if I find more code edits to make to fix this issue.

@lesleyodu
Copy link
Author

Add after line 60 in syntheisze/warcs.py:

if 'rel' in link.attrs and 'stylesheet' in link['rel']:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants