Update yt-trending-scraper to 3.1.0 (#2522)

This commit is contained in:
absidue 2022-09-01 02:55:10 +02:00 committed by GitHub
parent 67ec849f41
commit c0285c38c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 12 deletions

View File

@ -51,6 +51,7 @@
"@fortawesome/vue-fontawesome": "^2.0.2", "@fortawesome/vue-fontawesome": "^2.0.2",
"@freetube/youtube-chat": "^1.1.2", "@freetube/youtube-chat": "^1.1.2",
"@freetube/yt-comment-scraper": "^6.1.0", "@freetube/yt-comment-scraper": "^6.1.0",
"@freetube/yt-trending-scraper": "^3.1.0",
"@silvermine/videojs-quality-selector": "^1.2.5", "@silvermine/videojs-quality-selector": "^1.2.5",
"autolinker": "^3.15.0", "autolinker": "^3.15.0",
"electron-context-menu": "^3.1.2", "electron-context-menu": "^3.1.2",
@ -78,7 +79,6 @@
"youtube-suggest": "^1.1.2", "youtube-suggest": "^1.1.2",
"yt-channel-info": "^3.0.4", "yt-channel-info": "^3.0.4",
"yt-dash-manifest-generator": "1.1.0", "yt-dash-manifest-generator": "1.1.0",
"yt-trending-scraper": "^2.0.1",
"ytdl-core": "^4.11.1", "ytdl-core": "^4.11.1",
"ytpl": "^2.3.0", "ytpl": "^2.3.0",
"ytsr": "^3.8.0" "ytsr": "^3.8.0"

View File

@ -4,7 +4,7 @@ import IsEqual from 'lodash.isequal'
import FtLoader from '../../components/ft-loader/ft-loader.vue' import FtLoader from '../../components/ft-loader/ft-loader.vue'
import FtCard from '../../components/ft-card/ft-card.vue' import FtCard from '../../components/ft-card/ft-card.vue'
import FtElementList from '../../components/ft-element-list/ft-element-list.vue' import FtElementList from '../../components/ft-element-list/ft-element-list.vue'
import ytTrendScraper from 'yt-trending-scraper' import { calculateLengthInSeconds } from '@freetube/yt-trending-scraper/src/HtmlParser'
export default Vue.extend({ export default Vue.extend({
name: 'Search', name: 'Search',
@ -154,7 +154,7 @@ export default Vue.extend({
let videoDuration = video.duration let videoDuration = video.duration
const videoId = video.id const videoId = video.id
if (videoDuration !== null && videoDuration !== '' && videoDuration !== 'LIVE') { if (videoDuration !== null && videoDuration !== '' && videoDuration !== 'LIVE') {
videoDuration = ytTrendScraper.calculate_length_in_seconds(video.duration) videoDuration = calculateLengthInSeconds(video.duration)
} }
dataToShow.push( dataToShow.push(
{ {

View File

@ -7,7 +7,7 @@ import FtIconButton from '../../components/ft-icon-button/ft-icon-button.vue'
import FtFlexBox from '../../components/ft-flex-box/ft-flex-box.vue' import FtFlexBox from '../../components/ft-flex-box/ft-flex-box.vue'
import $ from 'jquery' import $ from 'jquery'
import ytrend from 'yt-trending-scraper' import { scrapeTrendingPage } from '@freetube/yt-trending-scraper'
export default Vue.extend({ export default Vue.extend({
name: 'Trending', name: 'Trending',
@ -124,7 +124,7 @@ export default Vue.extend({
geoLocation: this.region geoLocation: this.region
} }
ytrend.scrape_trending_page(param).then((result) => { scrapeTrendingPage(param).then((result) => {
const returnData = result.filter((item) => { const returnData = result.filter((item) => {
return item.type === 'video' || item.type === 'channel' || item.type === 'playlist' return item.type === 'video' || item.type === 'channel' || item.type === 'playlist'
}) })

View File

@ -1024,6 +1024,13 @@
dependencies: dependencies:
axios "^0.21.1" axios "^0.21.1"
"@freetube/yt-trending-scraper@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@freetube/yt-trending-scraper/-/yt-trending-scraper-3.1.0.tgz#51e20931b0d8a8d32216ecead320bbbcbb7ca959"
integrity sha512-qPyQaxU7Bv3e6HXn/ULH2h6iy1Egh3l7NKUgzuqPFHA7dAxbmMN7Ozr4QFnwXVnNYzfEdTsR+GFs9v71ChVJkQ==
dependencies:
axios "^0.27.2"
"@humanwhocodes/config-array@^0.5.0": "@humanwhocodes/config-array@^0.5.0":
version "0.5.0" version "0.5.0"
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9"
@ -1965,6 +1972,14 @@ axios@^0.26.1:
dependencies: dependencies:
follow-redirects "^1.14.8" follow-redirects "^1.14.8"
axios@^0.27.2:
version "0.27.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972"
integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==
dependencies:
follow-redirects "^1.14.9"
form-data "^4.0.0"
babel-eslint@^10.1.0: babel-eslint@^10.1.0:
version "10.1.0" version "10.1.0"
resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232" resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232"
@ -3717,6 +3732,11 @@ follow-redirects@^1.0.0, follow-redirects@^1.14.0, follow-redirects@^1.14.8:
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.0.tgz#06441868281c86d0dda4ad8bdaead2d02dca89d4" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.0.tgz#06441868281c86d0dda4ad8bdaead2d02dca89d4"
integrity sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ== integrity sha512-aExlJShTV4qOUOL7yF1U5tvLCB0xQuudbf6toyYA0E/acBNw71mvjFTnLaRp50aQaYocMR0a/RMMBIHeZnGyjQ==
follow-redirects@^1.14.9:
version "1.15.1"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.1.tgz#0ca6a452306c9b276e4d3127483e29575e207ad5"
integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==
forever-agent@~0.6.1: forever-agent@~0.6.1:
version "0.6.1" version "0.6.1"
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
@ -7491,13 +7511,6 @@ yt-dash-manifest-generator@1.1.0:
xml-js "^1.6.11" xml-js "^1.6.11"
ytdl-core "^3.2.2" ytdl-core "^3.2.2"
yt-trending-scraper@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/yt-trending-scraper/-/yt-trending-scraper-2.0.1.tgz#830ab96faaccca22001043ca72147f83fb099ffd"
integrity sha512-VTgIfVbRTMWUFn6Ir/XtEF2MBaYUU2JeaZxCtshfiyPI9yrOutp4A/0L755nl7Ip3Cigp8EW159/JH+z7Is7Jg==
dependencies:
axios "^0.21.1"
ytdl-core@^3.2.2: ytdl-core@^3.2.2:
version "3.4.2" version "3.4.2"
resolved "https://registry.yarnpkg.com/ytdl-core/-/ytdl-core-3.4.2.tgz#0d3d35f54d4f6b1de870b987f3d45e88c64b6a6c" resolved "https://registry.yarnpkg.com/ytdl-core/-/ytdl-core-3.4.2.tgz#0d3d35f54d4f6b1de870b987f3d45e88c64b6a6c"