Skip to content

Commit

Permalink
Fix TikTok regex
Browse files Browse the repository at this point in the history
  • Loading branch information
cguess committed Mar 29, 2024
1 parent 7bf554d commit f533c1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/media_sources/tik_tok_media_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def initialize(url)
sig { params(url: String).returns(T::Boolean) }
def self.validate_tiktok_post_url(url)
self.valid_host_name.each do |host_name|
return true if /#{host_name}\/@[\w]+\/video\/[0-9]+/.match?(url)
return true if /https:\/\/#{host_name}\/@[\w.-]+\/video\/[0-9]+/.match?(url)
end

raise InvalidTikTokPostUrlError, "TikTok url #{url} does not have the standard url format"
Expand Down
4 changes: 2 additions & 2 deletions app/models/scrape.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def send_notification
def send_completion_email
if self.user.present?
if self.removed
ScrapeMailer.with(url: self.url, user: self.user).scrape_removed_email.deliver_later
ScrapeMailer.with(url: self.url, user: self.user, scrape_id: self.id).scrape_removed_email.deliver_later
elsif self.error
ScrapeMailer.with(url: self.url, user: self.user).scrape_error_email.deliver_later
ScrapeMailer.with(url: self.url, user: self.user, scrape_id: self.id).scrape_error_email.deliver_later
else
ScrapeMailer.with(url: self.url, user: self.user).scrape_complete_email.deliver_later
end
Expand Down

0 comments on commit f533c1d

Please sign in to comment.