youtube_addy 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/youtube_addy.rb +2 -2
  2. metadata +1 -1
@@ -1,6 +1,6 @@
1
1
  class YouTubeAddy
2
2
  URL_Formats = {
3
- regular: /^(https?:\/\/)?(www\.)?youtube.com\/watch\?v=([^&]+)/,
3
+ regular: /^(https?:\/\/)?(www\.)?youtube.com\/watch\?(.*\&)?v=([^&]+)/,
4
4
  shortened: /^(https?:\/\/)?(www\.)?youtu.be\/([^&]+)/,
5
5
  invalid_chars: /[^a-zA-Z0-9\:\/\?\=\&\$\-\_\.\+\!\*\'\(\)\,]/
6
6
  }
@@ -13,7 +13,7 @@ class YouTubeAddy
13
13
  return nil if has_invalid_chars?(youtube_url)
14
14
 
15
15
  if match = URL_Formats[:regular].match(youtube_url)
16
- return match[3]
16
+ return match[4]
17
17
  elsif match = URL_Formats[:shortened].match(youtube_url)
18
18
  return match[3]
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: youtube_addy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: