film_snob 0.3.12 → 0.3.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4d6d1c208a6f4b8289a3292d1aa4b77879d5ea4
4
- data.tar.gz: 8e9bfc8ea1aaf761e996516024eb4520b4e75d6e
3
+ metadata.gz: 5e540dd00b0161a2fe79ce95e2abb04cb17370ee
4
+ data.tar.gz: ca75a3474f8708646a051f3f5de1bbbf8f129f95
5
5
  SHA512:
6
- metadata.gz: bc5bdff60a3979b17697072c596373c4c5507aa09728f3d8301fbf50619e785a8afbe1334aa223d81cacc920a819cb9024557d18a325d74a20930e8d819e48af
7
- data.tar.gz: 431fd6a6fbe16b2537733915ea5feff5100459c73c1e8d84f85018a3d628cc54de92eb4a6a4d39a3cd638c021b3b1436af1a5655f31e7464f1257ebbf5b404f5
6
+ metadata.gz: 8944edd5a9572e080c14178f968fd584ec9a1c8c1f57e15cb4b93c86d4b1dcd306209f12d74dc30c26e0538f1499387d4da79415eed8d757bc1ab4a1829758bb
7
+ data.tar.gz: b7790ee53b97c0e9f86b1c009a80482b4ca8e4f5c8f12b623d729c76c4440501ce238d0d6df55d487c816dbd619596d4900ba32ec7871ad65c50f4a713f8220c
@@ -1,3 +1,3 @@
1
1
  class FilmSnob
2
- VERSION = "0.3.12"
2
+ VERSION = "0.3.13"
3
3
  end
@@ -3,7 +3,7 @@ class FilmSnob
3
3
 
4
4
  def self.valid_url_patterns
5
5
  [
6
- %r{https?://(?:(?:www|m).)?youtube.com/watch\?(?:feature=[\w]+&)?v=([\w\d\-_]+)},
6
+ %r{https?://(?:(?:www|m).)?youtube.com/watch\?(?:feature=[\w\.]+&)?v=([\w\d\-_]+)},
7
7
  %r{https?://(?:(?:www|m).)?youtu.be/([\w\d\-_]+)}
8
8
  ]
9
9
  end
@@ -0,0 +1,54 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://www.youtube.com/oembed?url=https://www.youtube.com/watch?v=lC0JFXw_6kQ
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Date:
22
+ - Sun, 22 Jun 2014 23:16:49 GMT
23
+ Server:
24
+ - gwiseguy/2.0
25
+ Cache-Control:
26
+ - no-cache
27
+ X-Content-Type-Options:
28
+ - nosniff
29
+ P3p:
30
+ - CP="This is not a P3P policy! See http://support.google.com/accounts/bin/answer.py?answer=151657&hl=en
31
+ for more info."
32
+ Expires:
33
+ - Tue, 27 Apr 1971 19:44:06 EST
34
+ X-Xss-Protection:
35
+ - 1; mode=block; report=https://www.google.com/appserve/security-bugs/log/youtube
36
+ X-Frame-Options:
37
+ - ALLOWALL
38
+ Content-Type:
39
+ - application/json
40
+ Transfer-Encoding:
41
+ - chunked
42
+ body:
43
+ encoding: UTF-8
44
+ string: '{"version": "1.0", "author_url": "http:\/\/www.youtube.com\/user\/BINKBEATSmusic",
45
+ "thumbnail_url": "http:\/\/i1.ytimg.com\/vi\/lC0JFXw_6kQ\/hqdefault.jpg",
46
+ "provider_url": "http:\/\/www.youtube.com\/", "thumbnail_width": 480, "type":
47
+ "video", "title": "BINKBEATS Beats Unraveled #6: J. Dilla Live Mixtape", "provider_name":
48
+ "YouTube", "height": 270, "html": "\u003ciframe width=\"480\" height=\"270\"
49
+ src=\"http:\/\/www.youtube.com\/embed\/lC0JFXw_6kQ?feature=oembed\" frameborder=\"0\"
50
+ allowfullscreen\u003e\u003c\/iframe\u003e", "author_name": "BINKBEATSmusic",
51
+ "width": 480, "thumbnail_height": 360}'
52
+ http_version:
53
+ recorded_at: Sun, 22 Jun 2014 23:16:49 GMT
54
+ recorded_with: VCR 2.9.2
@@ -17,4 +17,15 @@ describe FilmSnob::YouTube do
17
17
  expect(film.title).to eq 'Pete Meets Olympic Freestyle Skier Torin Yater-Wallace'
18
18
  end
19
19
  end
20
+
21
+ it 'can handle even more junked up URLs' do
22
+ VCR.use_cassette('youtube/dilla') do
23
+ film = FilmSnob.new('http://www.youtube.com/watch?feature=youtu.be&v=lC0JFXw_6kQ')
24
+
25
+ expect(film).to be_watchable
26
+ expect(film.id).to eq 'lC0JFXw_6kQ'
27
+ expect{film.html}.to_not raise_error
28
+ expect(film.title).to eq 'BINKBEATS Beats Unraveled #6: J. Dilla Live Mixtape'
29
+ end
30
+ end
20
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: film_snob
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.12
4
+ version: 0.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Jacobson
@@ -135,6 +135,7 @@ files:
135
135
  - spec/cassettes/vimeo/stephen.yml
136
136
  - spec/cassettes/youtube/bad_youtube_url.yml
137
137
  - spec/cassettes/youtube/billy.yml
138
+ - spec/cassettes/youtube/dilla.yml
138
139
  - spec/cassettes/youtube/missing_video.yml
139
140
  - spec/cassettes/youtube/pete.yml
140
141
  - spec/film_snob_spec.rb
@@ -178,6 +179,7 @@ test_files:
178
179
  - spec/cassettes/vimeo/stephen.yml
179
180
  - spec/cassettes/youtube/bad_youtube_url.yml
180
181
  - spec/cassettes/youtube/billy.yml
182
+ - spec/cassettes/youtube/dilla.yml
181
183
  - spec/cassettes/youtube/missing_video.yml
182
184
  - spec/cassettes/youtube/pete.yml
183
185
  - spec/film_snob_spec.rb