Skip to content

Commit

Permalink
chore: clean up console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
okdargy committed Jan 25, 2024
1 parent a01e01c commit 38a0bfb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/services/tiktok.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ import { TikTokAPIResponse, AwemeList } from "../types/Services"
export async function grabAwemeId(videoId: string): Promise<String | Error> {
// https://vm.tiktok.com/ZMJmVWVpL/
const res = await fetch('https://vm.tiktok.com/' + videoId)
console.log('https://vm.tiktok.com/' + videoId, 'turned to', res.url)
const url = new URL(res.url)

const awemeIdPattern = /\/@[\w\d_.]+\/(video|photo)\/(\d{19})/
const match = url.pathname.match(awemeIdPattern)
console.log(url.pathname, match)

if (match) {
return match[2]
Expand Down
4 changes: 2 additions & 2 deletions src/templates/pages/Error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ export function ErrorResponse(error: string): JSX.Element {
MetaHelper([
{
"name": "og:title",
"content": `❌: ${error}`
"content": `❌ ${error}`
},
{
"name": "theme-color",
"content": "#dd2e44"
},
{
"name": "og:description",
"content": "An error occurred while trying to fetch the video."
"content": "An error occurred while trying to fetch the video. Please try again later."
},
{
"name": "og:site_name",
Expand Down

0 comments on commit 38a0bfb

Please sign in to comment.