mirror of
https://github.com/StrawberryMaster/wayback-machine-downloader.git
synced 2025-12-29 16:16:06 +00:00
Add possibility to save files to an user specified directory
This commit is contained in:
@@ -11,10 +11,11 @@ class WaybackMachineDownloader
|
||||
|
||||
VERSION = "0.5.3"
|
||||
|
||||
attr_accessor :base_url, :from_timestamp, :to_timestamp, :only_filter, :exclude_filter, :all, :list, :threads_count
|
||||
attr_accessor :base_url, :directory, :from_timestamp, :to_timestamp, :only_filter, :exclude_filter, :all, :list, :threads_count
|
||||
|
||||
def initialize params
|
||||
@base_url = params[:base_url]
|
||||
@directory = params[:directory]
|
||||
@from_timestamp = params[:from_timestamp].to_i
|
||||
@to_timestamp = params[:to_timestamp].to_i
|
||||
@only_filter = params[:only_filter]
|
||||
@@ -33,7 +34,15 @@ class WaybackMachineDownloader
|
||||
end
|
||||
|
||||
def backup_path
|
||||
'websites/' + backup_name + '/'
|
||||
if @directory
|
||||
if @directory[-1] == '/'
|
||||
@directory
|
||||
else
|
||||
@directory + '/'
|
||||
end
|
||||
else
|
||||
'websites/' + backup_name + '/'
|
||||
end
|
||||
end
|
||||
|
||||
def match_only_filter file_url
|
||||
|
||||
Reference in New Issue
Block a user