Skip to content

Commit f33c682

Browse files
authored
Merge pull request #100 from Fullscreen/change-scraping
Change heuristic for ContentNotFound error when scraping a video
2 parents 78e6453 + c94f09d commit f33c682

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/funky/html/page.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ module HTML
44
class Page
55
def get(video_id:)
66
body = response_for(video_id).body
7-
if body.include? '<meta name="description"'
8-
body
9-
else
7+
8+
if body.include? '<title id="pageTitle">Facebook</title>'
109
raise ContentNotFound, 'Please double check the ID and try again.'
10+
else
11+
body
1112
end
1213
end
1314

0 commit comments

Comments
 (0)