Fix #5063: Support downloading ArtStation video clips.

This commit is contained in:
evazion
2022-11-16 21:53:08 -06:00
parent 869fddbb1a
commit 96e1b6a512
2 changed files with 3 additions and 4 deletions

View File

@@ -57,8 +57,6 @@ class Source::Extractor
if asset[:asset_type] == "image"
asset_url(asset[:image_url])
elsif asset[:asset_type] == "video_clip"
next # XXX Skip for now; actually downloading these videos requires bypassing a Cloudflare captcha.
url = Nokogiri::HTML5.parse(asset[:player_embedded]).at("iframe").attr("src")
next if url.nil?

View File

@@ -72,7 +72,7 @@ module Sources
end
context "An ArtStation post with images and videos" do
strategy_should_work( # XXX Broken by Cloudflare captcha
strategy_should_work(
"https://www.artstation.com/artwork/0nP1e8",
image_urls: %w[
https://cdn.artstation.com/p/assets/images/images/040/979/418/original/yusuf-umar-workout-10mb.gif?1630425406
@@ -91,7 +91,8 @@ module Sources
context "An ArtStation video url" do
strategy_should_work(
"https://cdn-animation.artstation.com/p/video_sources/000/466/622/workout.mp4",
image_urls: ["https://cdn-animation.artstation.com/p/video_sources/000/466/622/workout.mp4"]
image_urls: ["https://cdn-animation.artstation.com/p/video_sources/000/466/622/workout.mp4"],
download_size: 377_969,
)
end