diff options
author | Christopher Vollick <psycotica0@gmail.com> | 2012-10-08 12:28:14 -0400 |
---|---|---|
committer | Christopher Vollick <psycotica0@gmail.com> | 2012-10-08 12:33:45 -0400 |
commit | 4fd8ee18e28ed9f15ef5573d6fbf1f11c8feb83d (patch) | |
tree | 21cfe8d811ad892affb66842f97e9592243665e1 | |
parent | c52cdf6c0f8a4ddf03041505a2094424d9dff2b4 (diff) | |
download | get-flash-videos-4fd8ee18e28ed9f15ef5573d6fbf1f11c8feb83d.tar.gz |
Bad RegEx Looking for Video ID
There was a "video_id=" in http://www.youtube.com/watch?v=9bZkp7q19f0,
but it didn't have an '&' after it as the regex was expecting, so it
overran a and consumed a substantial part of the page.
So, I've changed it.
I don't know if it's not matching now, so it's going to the more
effective fall-through, or it's more correct now, but either way it's
working.
-rw-r--r-- | lib/FlashVideo/Site/Youtube.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/FlashVideo/Site/Youtube.pm b/lib/FlashVideo/Site/Youtube.pm index ce84859..0abcf15 100644 --- a/lib/FlashVideo/Site/Youtube.pm +++ b/lib/FlashVideo/Site/Youtube.pm @@ -67,7 +67,7 @@ sub find_video { my $video_id; if ($browser->content =~ /(?:var pageVideoId =|(?:CFG_)?VIDEO_ID'?\s*:)\s*'(.+?)'/ - || $browser->content =~ /video_id=([^&]+)/ + || $browser->content =~ /[&?]video_id=([^&"]+)/ || $embed_url =~ /v=([^&]+)/ || $browser->content =~ /&video_id=([^&]+)&/) { $video_id = $1; |