Sha256: 1782d4bfc14d4317b0ed4b1e8f56bb706dd5691d604ec0bf90a20366c416b9e8
Contents?: true
Size: 613 Bytes
Versions: 12
Compression:
Stored size: 613 Bytes
Contents
# frozen_string_literal: true module DownloadTV ## # Interface for the grabbers class LinkGrabber attr_reader :url def initialize(url) @url = url end def agent @agent ||= Mechanize.new do |a| a.user_agent = DownloadTV::USER_AGENT a.read_timeout = 10 end end def online? url = if @url.include? '%s' format(@url, 'test') else @url end agent.head(url) true rescue StandardError false end def get_links(_show) raise NotImplementedError end end end
Version data entries
12 entries across 12 versions & 1 rubygems