|
@@ -126,8 +126,12 @@
|
|
|
<el-row type="flex" justify="space-between">
|
|
|
<div v-if="menuIndex == '5'" style="padding-top: 10px;">
|
|
|
<label>下载类型:</label>
|
|
|
- <el-checkbox :value="true" style="opacity: 0.6; cursor: not-allowed;">文章图/视频</el-checkbox>
|
|
|
- <el-popover placement="bottom" popper-class="popper-open" trigger="hover" content="实况(Live)图下载的格式是mp4,且同时下载任务量必须为1个">
|
|
|
+ <el-checkbox-group :min="1" v-model="settingArr" style="display: inline-block;" @input="settingGroup">
|
|
|
+ <el-checkbox label="mainImg">文章图</el-checkbox>
|
|
|
+ <el-checkbox label="video">视频</el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ <!-- <el-checkbox :value="true" style="opacity: 0.6; cursor: not-allowed;">文章图/视频</el-checkbox> -->
|
|
|
+ <el-popover placement="bottom" popper-class="popper-open" trigger="hover" content="实况(Live)图下载的格式是mp4视频">
|
|
|
<i class="el-icon-info" slot="reference" style="margin-left: 10px; color: #F56C6C;"></i>
|
|
|
</el-popover>
|
|
|
</div>
|
|
@@ -2380,47 +2384,51 @@
|
|
|
return outObj;
|
|
|
}, authority, this.execNum);
|
|
|
|
|
|
- if(imgInfo.mainImg.length >= 3){
|
|
|
+ if(imgInfo.mainImg.length >= 3 && authority){
|
|
|
imgInfo.mainImg = imgInfo.mainImg.slice(1, imgInfo.mainImg.length-1); //小红书轮播图第一个/最后一个和内容重复去掉
|
|
|
}
|
|
|
imgInfo.video = responseVideo;
|
|
|
|
|
|
- // 主图下载
|
|
|
- for(let j = 0; j < imgInfo.mainImg.length; j++){
|
|
|
- let fileName = imgInfo.mainImg[j].split('/').pop();
|
|
|
- if(fileName){
|
|
|
- let queryIndex = fileName.indexOf('?');
|
|
|
- if (queryIndex !== -1) {
|
|
|
- fileName = fileName.substr(0, queryIndex);
|
|
|
- }
|
|
|
-
|
|
|
- let num = Number(j) + 1;
|
|
|
- let suffix = '.jpg';
|
|
|
- if(fileName.lastIndexOf('.') > -1){
|
|
|
- suffix = fileName.substr(fileName.lastIndexOf('.'));
|
|
|
+ if(this.settingArr.indexOf('mainImg') > -1){
|
|
|
+ // 主图下载
|
|
|
+ for(let j = 0; j < imgInfo.mainImg.length; j++){
|
|
|
+ let fileName = imgInfo.mainImg[j].split('/').pop();
|
|
|
+ if(fileName){
|
|
|
+ let queryIndex = fileName.indexOf('?');
|
|
|
+ if (queryIndex !== -1) {
|
|
|
+ fileName = fileName.substr(0, queryIndex);
|
|
|
+ }
|
|
|
+
|
|
|
+ let num = Number(j) + 1;
|
|
|
+ let suffix = '.jpg';
|
|
|
+ if(fileName.lastIndexOf('.') > -1){
|
|
|
+ suffix = fileName.substr(fileName.lastIndexOf('.'));
|
|
|
+ }
|
|
|
+
|
|
|
+ let outputPath = urlInfo.newPath + '\\文章图' + num + suffix;
|
|
|
+ await this.downloadImage(imgInfo.mainImg[j], outputPath, urlInfo);
|
|
|
}
|
|
|
-
|
|
|
- let outputPath = urlInfo.newPath + '\\文章图' + num + suffix;
|
|
|
- await this.downloadImage(imgInfo.mainImg[j], outputPath, urlInfo);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //视频下载
|
|
|
- for(let j = 0; j < imgInfo.video.length; j++){
|
|
|
- let fileName = imgInfo.video[j].split('/').pop();
|
|
|
- if(fileName){
|
|
|
- let queryIndex = fileName.indexOf('?');
|
|
|
- if (queryIndex !== -1) {
|
|
|
- fileName = fileName.substr(0, queryIndex);
|
|
|
- }
|
|
|
-
|
|
|
- let num = Number(j) + 1;
|
|
|
- let suffix = '.mp4';
|
|
|
- if(fileName.lastIndexOf('.') > -1){
|
|
|
- suffix = fileName.substr(fileName.lastIndexOf('.'));
|
|
|
+ if(this.settingArr.indexOf('video') > -1){
|
|
|
+ //视频下载
|
|
|
+ for(let j = 0; j < imgInfo.video.length; j++){
|
|
|
+ let fileName = imgInfo.video[j].split('/').pop();
|
|
|
+ if(fileName){
|
|
|
+ let queryIndex = fileName.indexOf('?');
|
|
|
+ if (queryIndex !== -1) {
|
|
|
+ fileName = fileName.substr(0, queryIndex);
|
|
|
+ }
|
|
|
+
|
|
|
+ let num = Number(j) + 1;
|
|
|
+ let suffix = '.mp4';
|
|
|
+ if(fileName.lastIndexOf('.') > -1){
|
|
|
+ suffix = fileName.substr(fileName.lastIndexOf('.'));
|
|
|
+ }
|
|
|
+ let outputPath = urlInfo.newPath + '\\视频' + num + suffix;
|
|
|
+ await this.downloadImage(imgInfo.video[j], outputPath, urlInfo);
|
|
|
}
|
|
|
- let outputPath = urlInfo.newPath + '\\视频' + num + suffix;
|
|
|
- await this.downloadImage(imgInfo.video[j], outputPath, urlInfo);
|
|
|
}
|
|
|
}
|
|
|
|