<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Digital Preservation Q&amp;A - Recent questions tagged warc</title>
<link>https://qanda.digipres.org/tag/warc</link>
<description>Powered by Question2Answer</description>
<item>
<title>Best way to crawl website from localhost with wget, preserving all files in source directory</title>
<link>https://qanda.digipres.org/1166/crawl-website-localhost-preserving-files-source-directory</link>
<description>&lt;p&gt;
	We recently recovered the contents of an old (2004) website from CD-ROM. I managed to get a local instance of the site running using the Apache web server; by editing the machine’s &lt;em&gt;hosts&lt;/em&gt; file the site is available on that local machine from its original URL, which is &lt;code&gt;&lt;a href=&quot;http://www.nl-menu.nl&quot; rel=&quot;nofollow&quot;&gt;http://www.nl-menu.nl&lt;/a&gt;&lt;/code&gt; (some more context can be found &lt;a rel=&quot;nofollow&quot; href=&quot;http://openpreservation.org/blog/2018/04/24/resurrecting-the-first-dutch-web-index-nl-menu-revisited/&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;
	I’m now looking into ways to crawl the contents of the site into a WARC, so we can ingest it into our web archive. After initial experiments with Heritrix failed, I moved on to wget. After some experimentation the following wget command appeared to work reasonably well:&lt;/p&gt;
&lt;h2 id=&quot;attempt-1-mirror-from-site-root&quot;&gt;
	Attempt 1: mirror from site root&lt;/h2&gt;
&lt;pre&gt;
&lt;code&gt;wget --mirror \
    --page-requisites \
    --warc-file=&quot;nl-menu&quot; \
    --warc-cdx \
    --output-file=&quot;nl-menu.log&quot; \
    &lt;a href=&quot;http://www.nl-menu.nl&quot; rel=&quot;nofollow&quot;&gt;http://www.nl-menu.nl&lt;/a&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	However, closer inspection of the result showed that about 668 files in the source directory are missing in the resulting WARC file. The majority (90%) of these files are “orphan” resources that are not used/referenced by any of the HTML files in the crawl. However, the remaining 10% of missing files are resourced that &lt;em&gt;are&lt;/em&gt; referenced, in most cases through JavaScript variables. These aren’t picked up by wget, and therefore they end up missing in the WARC. So I am looking for a way to force wget to include these resources anyway.&lt;/p&gt;
&lt;h2 id=&quot;attempt-2-use-input-file&quot;&gt;
	Attempt 2: use –input-file&lt;/h2&gt;
&lt;p&gt;
	At first wget’s &lt;code&gt;--input-file&lt;/code&gt; switch (which takes a list of URLs) looked like a good way to achieve this. I created a directory listing of all files that are part of the website, and then transformed them into corresponding URLs:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;find /var/www/www.nl-menu.nl -type f \
    | sed -e 's/\/var\/www\//http:\/\//g' &amp;gt; urls.txt&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	Then I ran wget like this (note that I removed the &lt;code&gt;--mirror&lt;/code&gt; option, as this apparently causes wget to do a recursive crawl &lt;em&gt;for each single URL&lt;/em&gt; in the list, which takes forever):&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;wget --page-requisites \
    --warc-file=&quot;nl-menu&quot; \
    --warc-cdx \
    --output-file=&quot;nl-menu.log&quot; \
    --input-file=urls.txt&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	This results in a WARC file that contains &lt;em&gt;all&lt;/em&gt; files from the source directory: perfect! But it does introduce a different problem: when I try to access the WARC using &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/webrecorder/pywb&quot;&gt;pywb&lt;/a&gt;, it turns out that the WARC is made up of 85864 individual captures (i.e.&amp;nbsp;each file appears to be treated as an individual capture)! This makes rendering of the WARC impossible (loading the list of capture alone takes forever to begin with).&lt;/p&gt;
&lt;h2 id=&quot;attempt-3-include-list-of-urls-in-crawl&quot;&gt;
	Attempt 3: include list of URLs in crawl&lt;/h2&gt;
&lt;p&gt;
	So as a last resort I created a list of all URLs in HTML format, and put that file in the source directory. Steps:&lt;/p&gt;
&lt;ol style=&quot;list-style-type: decimal;&quot;&gt;
	&lt;li&gt;
		&lt;p&gt;
			Create list of URLS in Markdown format (add “&amp;lt;” and “&amp;gt;” pre-and suffix to each line):&lt;/p&gt;
		&lt;p&gt;
			&lt;code&gt;find /var/www/www.nl-menu.nl -type f | sed -e 's/\/var\/www\//&amp;lt;http:\/\//; s/$/&amp;gt;\n/g' &amp;gt; urls.txt&lt;/code&gt;&lt;/p&gt;
	&lt;/li&gt;
	&lt;li&gt;
		&lt;p&gt;
			Replace any whitespace characters with &lt;em&gt;%20&lt;/em&gt; to avoid malformed URLs:&lt;/p&gt;
		&lt;p&gt;
			&lt;code&gt;sed -i 's/\ /%20/g' urls.txt&lt;/code&gt;&lt;/p&gt;
	&lt;/li&gt;
	&lt;li&gt;
		&lt;p&gt;
			Convert URL list to HTML which is placed at the root directory of the source dir:&lt;/p&gt;
		&lt;p&gt;
			&lt;code&gt;sudo pandoc -s urls.txt -o /var/www/www.nl-menu.nl/urls.html&lt;/code&gt;&lt;/p&gt;
	&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
	Then I ran wget, using the above URL list as crawl root:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;wget --mirror \
    --page-requisites \
    --warc-file=&quot;nl-menu&quot; \
    --warc-cdx \
    --output-file=&quot;nl-menu.log&quot; \
    &lt;a href=&quot;http://www.nl-menu.nl/urls.html&quot; rel=&quot;nofollow&quot;&gt;http://www.nl-menu.nl/urls.html&lt;/a&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	The resulting WARC contains all files that are in the source dir, and it can be accessed as one single capture in pywb. The obvious downside of this hack is that it compromises the integrity of the ‘original’ website by adding one (huge) HTML file that was not part of the original site to the WARC.&lt;/p&gt;
&lt;p&gt;
	This makes me wonder if there is another, more elegant way to do this that I have overlooked here? Any suggestions welcome!&lt;/p&gt;
&lt;p&gt;
	BTW I know this question is somewhat similar to [this earlier one] (&lt;a href=&quot;http://qanda.digipres.org/337/there-web-archiving-tool-that-produces-warc-directory-tree),&quot; rel=&quot;nofollow&quot;&gt;http://qanda.digipres.org/337/there-web-archiving-tool-that-produces-warc-directory-tree),&lt;/a&gt; but option 2 as mentioned by &lt;span class=&quot;citation&quot;&gt;@anjackson&lt;/span&gt; there looks similar to Attempt 2 in my case.&lt;/p&gt;</description>
<guid isPermaLink="true">https://qanda.digipres.org/1166/crawl-website-localhost-preserving-files-source-directory</guid>
<pubDate>Tue, 03 Jul 2018 14:16:10 +0000</pubDate>
</item>
<item>
<title>Merging &amp; Deduping WARC files</title>
<link>https://qanda.digipres.org/1155/merging-%26-deduping-warc-files</link>
<description>Is there any programme/script that will take a group of WARC files and merge them, removing exact duplicate responses ?&lt;br /&gt;
&lt;br /&gt;
I realise this probably goes somewhat against good practice, but for reasons of space I would like to remove the approximately 90% replication of content (e.g. unchanged images) but retain the varying parts.</description>
<guid isPermaLink="true">https://qanda.digipres.org/1155/merging-%26-deduping-warc-files</guid>
<pubDate>Tue, 01 May 2018 12:06:57 +0000</pubDate>
</item>
<item>
<title>Setting a custom date for wget or wpull?</title>
<link>https://qanda.digipres.org/1097/setting-a-custom-date-for-wget-or-wpull</link>
<description>Both wget and wpull, when saving to WARC, will store the date and time of when the archiving action took place in every HTTP request.&lt;br /&gt;
&lt;br /&gt;
Is there a way to modify this date, either during or after recording?</description>
<guid isPermaLink="true">https://qanda.digipres.org/1097/setting-a-custom-date-for-wget-or-wpull</guid>
<pubDate>Thu, 17 Dec 2015 11:47:58 +0000</pubDate>
</item>
<item>
<title>Any LTP &quot;Packaging Format&quot; Standard you Support that Makes More Sense than WARC?</title>
<link>https://qanda.digipres.org/830/packaging-format-standard-support-makes-more-sense-than-warc</link>
<description>&lt;p&gt;
	Here's my question:&amp;nbsp;&lt;strong&gt;Do you prefer a packaging format other than WARC? What other justifications should I take into account? Could you share additional resources for my consideration ( in addition to those below?)&amp;nbsp;&lt;/strong&gt;And I'll elaborate:&lt;/p&gt;
&lt;p&gt;
	We generally agree that digital permanent records should be kept in open and supported format (tools and communities). We even have a broad selection of formats to chose from (from TIFF/JPEG2000 through PDF/A to XML). What remains, in my view, is a similar broad agreement on the package format that house the above content and linked metadata. The target here is the format of the container, wrapper, or capsule.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	There are many requirements that this container should meet, and by far, I like that the container be extendable whereby one can add more content, additional metadata, user contributed context, etc.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	Sofar though, .zip container has more or less led the charge, though other formats such as .warc are emerging from studies and comparaisons and showing more promise, which prompts me to ask:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&lt;strong&gt;Do you prefer a packaging format other than WARC? What other justifications should I take into account? Could you share additional resources I could consider in addition to these below?&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		Recommendations/studies supporting WARC
		&lt;ul&gt;
			&lt;li&gt;
				For web objects:&amp;nbsp;&lt;a href=&quot;http://www.getpocket.com/a/read/777166755&quot; rel=&quot;nofollow&quot;&gt;http://www.getpocket.com/a/read/777166755&lt;/a&gt;&lt;/li&gt;
			&lt;li&gt;
				For all objects:&amp;nbsp;&lt;a href=&quot;https://fedora.phaidra.univie.ac.at/fedora/get/o:293682/bdef:Content/get&quot; rel=&quot;nofollow&quot;&gt;https://fedora.phaidra.univie.ac.at/fedora/get/o:293682/bdef:Content/get&lt;/a&gt;&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;
		Standard using ZIP as container/wrapper/capsule:
		&lt;ul&gt;
			&lt;li&gt;
				Victorian Electronic Records Strategy / VERS Encapsulated Object (VEO) :&amp;nbsp;&lt;a href=&quot;http://prov.vic.gov.au/wp-content/uploads/2014/05/VERSStdRevisionProposal-v1-0.pdf&quot; rel=&quot;nofollow&quot;&gt;http://prov.vic.gov.au/wp-content/uploads/2014/05/VERSStdRevisionProposal-v1-0.pdf&lt;/a&gt;&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;
		Standard-to-be considering SIRF or an unspecified format (needs proof of concept)
		&lt;ul&gt;
			&lt;li&gt;
				Storage Industry Networking Association's SIRF (Self-Contained Information Retention Format (&amp;nbsp;&lt;a href=&quot;http://www.snia.org/SIRF&quot; rel=&quot;nofollow&quot;&gt;http://www.snia.org/SIRF&lt;/a&gt;&amp;nbsp;; )&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
	Answers, links and comments will be well received!&lt;/p&gt;</description>
<guid isPermaLink="true">https://qanda.digipres.org/830/packaging-format-standard-support-makes-more-sense-than-warc</guid>
<pubDate>Fri, 13 Feb 2015 21:20:18 +0000</pubDate>
</item>
<item>
<title>Tool(s) for extracting administrative metadata from WARC?</title>
<link>https://qanda.digipres.org/779/tool-s-for-extracting-administrative-metadata-from-warc</link>
<description>I'm researching best practices for administrative metadata--preservation metadata in particular--for web archives. So far I've found some very helpful rationales and schemas, all PREMIS-in-METS-based, but I haven't seen anything that directly explains how one gets from point A to point B. That is, I haven't seen any descriptions of the steps nor the tools used to actually extract this type of metadata (or as much as can reasonably be gleaned) from WARCs. Have you? Have you extracted administrative metadata from your WARCs and lived to tell the tale? I'd love to know what you used and what you thought of the process.</description>
<guid isPermaLink="true">https://qanda.digipres.org/779/tool-s-for-extracting-administrative-metadata-from-warc</guid>
<pubDate>Thu, 29 Jan 2015 07:08:14 +0000</pubDate>
</item>
<item>
<title>Is there a web archiving tool that produces WARC + directory tree?</title>
<link>https://qanda.digipres.org/337/there-web-archiving-tool-that-produces-warc-directory-tree</link>
<description>&lt;p style=&quot;margin: 0px 0px 20px; color: rgb(119, 119, 119); font-family: Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px;&quot;&gt;
	An important feature of any web archiving tool is the ability to specify that one would like to pull down embedded resources (&quot;page requisites&quot; in the parlance of wget) that are hosted on a domain other than the site that is the target of the crawl. Such cases are found not only as examples of people &quot;hot-linking&quot; other people's images, but is encountered heavily on sites with cloud based content delivery networks, such as Tumblr. Including such assets in a crawl is absolutely necessary when one's aim is to achieve a complete mirror of a site.&lt;/p&gt;
&lt;p style=&quot;margin: 0px 0px 20px; color: rgb(119, 119, 119); font-family: Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px;&quot;&gt;
	&lt;span style=&quot;color: rgb(34, 34, 34); font-weight: 700;&quot;&gt;Heritrix&lt;/span&gt;&amp;nbsp;has an option for including such assets in the crawl scope:&lt;a rel=&quot;nofollow&quot; href=&quot;https://webarchive.jira.com/wiki/display/Heritrix/unexpected+offsite+content&quot; style=&quot;color: rgb(51, 153, 204); text-decoration: none;&quot;&gt;https://webarchive.jira.com/wiki/display/Heritrix/unexpected+offsite+content&lt;/a&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0px 0px 20px; color: rgb(119, 119, 119); font-family: Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px;&quot;&gt;
	As does&amp;nbsp;&lt;span style=&quot;color: rgb(34, 34, 34); font-weight: 700;&quot;&gt;Httrack&lt;/span&gt;, using the --near flag:\&lt;/p&gt;
&lt;p style=&quot;margin: 0px 0px 20px; color: rgb(119, 119, 119); font-family: Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px;&quot;&gt;
	&lt;a rel=&quot;nofollow&quot; href=&quot;http://www.httrack.com/html/fcguide.html&quot; style=&quot;color: rgb(51, 153, 204); text-decoration: none;&quot;&gt;http://www.httrack.com/html/fcguide.html&lt;/a&gt;\ But of course, Httrack does not offer WARC output.&lt;/p&gt;
&lt;p style=&quot;margin: 0px 0px 20px; color: rgb(119, 119, 119); font-family: Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px;&quot;&gt;
	&lt;span style=&quot;color: rgb(34, 34, 34); font-weight: 700;&quot;&gt;Wget&lt;/span&gt;&amp;nbsp;has the -H flag, allowing one to &quot;span hosts&quot; (in other words hit sites with domain names other than the starting url), it lacks the ability to specify that the crawler should span hosts only for page requisites, and so tries to download the entire web if one combines an infinitely recursive crawl with -H. There are some hacky ways of getting around this, but they aren't pretty or reliable. The great thing about Wget though is that it allows the user to output WARC&amp;nbsp;&lt;em&gt;and&lt;/em&gt;&amp;nbsp;a directory tree of the crawled site, thus not locking one in to WARC completely.&lt;/p&gt;
&lt;p style=&quot;margin: 0px 0px 20px; color: rgb(119, 119, 119); font-family: Lato, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px;&quot;&gt;
	Are there any tools of the trade that allow one to conduct the comprehensive type of crawl mentioned above, but also have the affordance of outputting WARC,&amp;nbsp;&lt;em&gt;and&lt;/em&gt;&amp;nbsp;a directory tree?&lt;/p&gt;</description>
<guid isPermaLink="true">https://qanda.digipres.org/337/there-web-archiving-tool-that-produces-warc-directory-tree</guid>
<pubDate>Tue, 09 Sep 2014 20:05:01 +0000</pubDate>
</item>
</channel>
</rss>