url_scrubber 0.8.26 → 0.8.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/url_scrubber/version.rb +1 -1
- data/lib/url_scrubber.rb +12 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 07c9c4d8e5cec292a17f0765d8ff35a304dd53f329f351749d75730aa8b96120
|
|
4
|
+
data.tar.gz: c8a5cbcd3c29bbf612e55aee468fccf2cb60b6c0e51f4511cf6f21814b5980e3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b85c602db592ebd0bbb1407c219c63f34c11d249282ad7473894ec83f8074ed318662c9397dab112fbcbd7cc6c2fff9eb08449d0c5e65e7a3a1d1e2e7117f33f
|
|
7
|
+
data.tar.gz: 2efa922c763806b923e445f5311b5e555c95ebcd5d272549ed5dce1dfc85b6ad77657db0456c20e6039bc241df8de5a0559548dfef3140c1ab2f9c86a848d139
|
data/lib/url_scrubber/version.rb
CHANGED
data/lib/url_scrubber.rb
CHANGED
|
@@ -10,6 +10,8 @@ module UrlScrubber
|
|
|
10
10
|
return url if url.blank?
|
|
11
11
|
return url if /^app:\/\//.match(url) # Do not scrub app-only URLs
|
|
12
12
|
return url if /^https?:\/\/(www.)?business.tiktok\.com\/manage\//.match(url) # Don't scrub tik tok business manager urls, quick fix until we can implement a different solution, https://business.tiktok.com/manage/overview?org_id=6974497704617492482
|
|
13
|
+
#return url if /^http(s)?:\/\/(.+\.)?youtube\.com\/watch\?v=(?<vid>[^&]+)/i.match(url) # Don't scrub youtube video urls, just let it through!
|
|
14
|
+
|
|
13
15
|
|
|
14
16
|
url = url.clone # don't modify the original argument
|
|
15
17
|
|
|
@@ -250,8 +252,16 @@ module UrlScrubber
|
|
|
250
252
|
# We need to allow the /user version of the URL due to how YouTube allows users to have their own URL
|
|
251
253
|
# which is not separate channel with it's own customUrl.
|
|
252
254
|
# url.sub!('youtube.com/user/', 'youtube.com/')
|
|
253
|
-
|
|
254
|
-
|
|
255
|
+
|
|
256
|
+
regex1 = /^http(s)?:\/\/(.+\.)?youtube\.com\/watch\?v=(?<vid>[^&]+)/i
|
|
257
|
+
|
|
258
|
+
if mdata = url.match(regex1)
|
|
259
|
+
url = "http://youtube.com/watch?v=#{mdata[:vid]}"
|
|
260
|
+
else
|
|
261
|
+
url.sub!('youtube.com/profile?user=', 'youtube.com/')
|
|
262
|
+
drop_url_query!(url)
|
|
263
|
+
end
|
|
264
|
+
|
|
255
265
|
url
|
|
256
266
|
end
|
|
257
267
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: url_scrubber
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.28
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Colin Langton
|
|
@@ -12,7 +12,7 @@ authors:
|
|
|
12
12
|
autorequire:
|
|
13
13
|
bindir: bin
|
|
14
14
|
cert_chain: []
|
|
15
|
-
date:
|
|
15
|
+
date: 2026-04-29 00:00:00.000000000 Z
|
|
16
16
|
dependencies:
|
|
17
17
|
- !ruby/object:Gem::Dependency
|
|
18
18
|
name: rspec
|