chanfasf commited on
Commit
dfa2396
·
1 Parent(s): 1bfc94a

Fix: TikTok links redirect to creator profile page

Browse files
Files changed (1) hide show
  1. backend/app/crawlers/tiktok.py +3 -3
backend/app/crawlers/tiktok.py CHANGED
@@ -200,7 +200,7 @@ class TikTokCrawler:
200
  "channel_id": str(item.get("author", {}).get("id", "")),
201
  "published_at": datetime.now(timezone.utc),
202
  "thumbnail_url": item.get("video", {}).get("cover", ""),
203
- "video_url": f"https://urlebird.com/video/{item.get('id', '')}/",
204
  "duration": str(item.get("video", {}).get("duration", 0)),
205
  "category": "",
206
  "tags": "",
@@ -312,7 +312,7 @@ class TikTokCrawler:
312
  "channel_id": str(random.randint(1000000000000000000, 9999999999999999999)),
313
  "published_at": datetime.now(timezone.utc) - __import__('datetime').timedelta(hours=random.randint(1, 168)),
314
  "thumbnail_url": f"https://picsum.photos/seed/{video_id}/400/600",
315
- "video_url": f"https://urlebird.com/video/{video_id}/",
316
  "duration": str(random.randint(5, 60)),
317
  "category": "",
318
  "tags": "fyp,viral,trending",
@@ -434,7 +434,7 @@ class TikTokCrawler:
434
  "channel_id": str(author.get("id", author.get("uid", ""))),
435
  "published_at": published_at,
436
  "thumbnail_url": cover,
437
- "video_url": f"https://urlebird.com/video/{video_id}/",
438
  "duration": str(video_info.get("duration", 0)),
439
  "category": "",
440
  "tags": ",".join(
 
200
  "channel_id": str(item.get("author", {}).get("id", "")),
201
  "published_at": datetime.now(timezone.utc),
202
  "thumbnail_url": item.get("video", {}).get("cover", ""),
203
+ "video_url": f"https://www.tiktok.com/@{item.get('author', {}).get('uniqueId', '')}",
204
  "duration": str(item.get("video", {}).get("duration", 0)),
205
  "category": "",
206
  "tags": "",
 
312
  "channel_id": str(random.randint(1000000000000000000, 9999999999999999999)),
313
  "published_at": datetime.now(timezone.utc) - __import__('datetime').timedelta(hours=random.randint(1, 168)),
314
  "thumbnail_url": f"https://picsum.photos/seed/{video_id}/400/600",
315
+ "video_url": f"https://www.tiktok.com/@{creator}",
316
  "duration": str(random.randint(5, 60)),
317
  "category": "",
318
  "tags": "fyp,viral,trending",
 
434
  "channel_id": str(author.get("id", author.get("uid", ""))),
435
  "published_at": published_at,
436
  "thumbnail_url": cover,
437
+ "video_url": f"https://www.tiktok.com/@{author.get('uniqueId', author.get('unique_id', ''))}",
438
  "duration": str(video_info.get("duration", 0)),
439
  "category": "",
440
  "tags": ",".join(