Skip to content

Commit

Permalink
fix video download in all related methods
Browse files Browse the repository at this point in the history
  • Loading branch information
drawrowfly committed Oct 25, 2020
1 parent 8036a88 commit 780737e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/Downloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ export class Downloader {
r.get({
url: item.videoUrlNoWaterMark ? item.videoUrlNoWaterMark : item.videoUrl,
headers: {
'user-agent': 'okhttp',
'user-agent': this.userAgent,
referer: 'https://www.tiktok.com/',
Cookie: `tt_webid_v2=${this.tt_webid_v2}`,
},
})
.on('response', response => {
Expand Down
1 change: 1 addition & 0 deletions src/core/TikTok.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ export class TikTokScraper extends EventEmitter {
...(form ? { form } : {}),
headers: {
'User-Agent': this.userAgent,
Cookie: `tt_webid_v2=${this.tt_webid_v2}`,
...headers,
},
...(json ? { json: true } : {}),
Expand Down

0 comments on commit 780737e

Please sign in to comment.