Skip to content

Commit

Permalink
Update Download Weibo Images & videos.user.js
Browse files Browse the repository at this point in the history
Trying to avoid '403 forbidden' when downloading videos.
  • Loading branch information
owendswang authored Aug 8, 2023
1 parent ffeb784 commit b88aedd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Download Weibo Images & videos.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name Download Weibo Images & Videos (Only support new version weibo UI)
// @name:zh-CN 下载微博图片和视频(仅支持新版界面)
// @version 0.9.5
// @version 0.9.6
// @description Download images and videos from new version weibo UI webpage.
// @description:zh-CN 从新版微博界面下载图片和视频。
// @author OWENDSWANG
Expand Down Expand Up @@ -395,15 +395,15 @@
let originalName = vidName.split('.')[0];
let ext = vidName.split('.')[1];
const setName = getName((GM_getValue('retweetMode', false) && retweetPostId) ? GM_getValue('retweetFileName', '{original}.{ext}') : GM_getValue('dlFileName', '{original}.{ext}'), originalName, ext, userName, userId, postId, postUid, index.toString().padStart(padLength, '0'), postTime, text, retweetPostId, retweetUserName, retweetUserId, retweetPostUid, retweetPostTime, retweetText);
newList.push({ url: largeVidUrl, name: setName });
newList.push({ url: largeVidUrl, name: setName, headerFlag: true });
if(mediaInfo.hasOwnProperty('pic_info')) {
let picUrl = mediaInfo.pic_info.pic_big.url;
let largePicUrl = picUrl.replace('/orj480/', '/large/');
let picName = largePicUrl.split('/')[largePicUrl.split('/').length - 1].split('?')[0];
let originalName = picName.split('.')[0];
let ext = picName.split('.')[1];
const setName = getName((GM_getValue('retweetMode', false) && retweetPostId) ? GM_getValue('retweetFileName', '{original}.{ext}') : GM_getValue('dlFileName', '{original}.{ext}'), originalName, ext, userName, userId, postId, postUid, index.toString().padStart(padLength, '0'), postTime, text, retweetPostId, retweetUserName, retweetUserId, retweetPostUid, retweetPostTime, retweetText);
newList.push({url: largePicUrl, name: setName });
newList.push({url: largePicUrl, name: setName, headerFlag: true });
}
return newList;
}
Expand All @@ -425,7 +425,7 @@
let originalName = videoName.split('.')[0];
let ext = videoName.split('.')[1];
const setName = getName((GM_getValue('retweetMode', false) && retweetPostId) ? GM_getValue('retweetFileName', '{original}.{ext}') : GM_getValue('dlFileName', '{original}.{ext}'), originalName, ext, userName, userId, postId, postUid, index.toString().padStart(padLength, '0'), postTime, text, retweetPostId, retweetUserName, retweetUserId, retweetPostUid, retweetPostTime, retweetText);
newList.push({ url: videoUrl, name: setName });
newList.push({ url: videoUrl, name: setName, headerFlag: true });
}
return newList;
}
Expand Down

0 comments on commit b88aedd

Please sign in to comment.