Wait for account info to create the folder
This commit is contained in:
parent
97cca39507
commit
233ebb78d8
|
@ -28,10 +28,6 @@ if user.nil?
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
|
|
||||||
path = user
|
|
||||||
path = File.join options[:output], user unless options[:output].nil?
|
|
||||||
FileUtils.mkdir_p path unless File.exist? path
|
|
||||||
|
|
||||||
# this is v gross, but they probably do it like this on purpose
|
# this is v gross, but they probably do it like this on purpose
|
||||||
initial = open "https://vsco.co/#{user}/images/1"
|
initial = open "https://vsco.co/#{user}/images/1"
|
||||||
vs = /vs=(\S*);/.match(initial.meta['set-cookie']).captures[0]
|
vs = /vs=(\S*);/.match(initial.meta['set-cookie']).captures[0]
|
||||||
|
@ -39,6 +35,10 @@ siteId = JSON.parse(/window.VSCOVARS.SiteSettings = ({.*})/.match(initial.read)
|
||||||
|
|
||||||
images = JSON.load(open("https://vsco.co/ajxp/#{vs}/2.0/medias?site_id=#{siteId}&page=0&size=-1", 'Cookie' => "vs=#{vs};"))['media']
|
images = JSON.load(open("https://vsco.co/ajxp/#{vs}/2.0/medias?site_id=#{siteId}&page=0&size=-1", 'Cookie' => "vs=#{vs};"))['media']
|
||||||
|
|
||||||
|
path = user
|
||||||
|
path = File.join options[:output], user unless options[:output].nil?
|
||||||
|
FileUtils.mkdir_p path unless File.exist? path
|
||||||
|
|
||||||
images.each_with_index do |r, i|
|
images.each_with_index do |r, i|
|
||||||
print "Image #{i + 1} of #{images.length}\r"
|
print "Image #{i + 1} of #{images.length}\r"
|
||||||
$stdout.flush
|
$stdout.flush
|
||||||
|
|
Loading…
Reference in New Issue