Skip to content

Commit

Permalink
Merge branch 'development' into update-linters-add-style-linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunkyProgrammer committed Jan 3, 2023
2 parents 34ad98d + 8c18141 commit 78be5e9
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- run: yarn run ci
- run: yarn run lint
- name: Get Version Number
uses: nyaayaya/package-version@v1
uses: jozsefsallai/node-package-version@v1.0.4
with:
path: 'package.json'
follow-symlinks: false
Expand All @@ -84,7 +84,7 @@ jobs:
# script: if ${{ env.IS_DEV }} then echo "::set-output name=VERSION_NUMBER::${{ env.VERSION_NUMBER_NIGHTLY }}" else echo "::set-output name=VERSION_NUMBER::${{ env.VERSION_NUMBER }}" fi

- name: Update package.json version
uses: jossef/action-set-json-field@v2
uses: jossef/action-set-json-field@v2.1
with:
file: package.json
field: version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- run: yarn run lint

- name: Get Version Number
uses: nyaayaya/package-version@v1
uses: jozsefsallai/node-package-version@v1.0.4
with:
path: 'package.json'
follow-symlinks: false
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"vue-observe-visibility": "^1.0.0",
"vue-router": "^3.6.5",
"vuex": "^3.6.2",
"youtubei.js": "^2.6.0",
"youtubei.js": "^2.7.0",
"yt-channel-info": "^3.2.1",
"yt-dash-manifest-generator": "1.1.0",
"ytdl-core": "https://github.com/absidue/node-ytdl-core#fix-likes-extraction",
Expand Down
34 changes: 11 additions & 23 deletions src/renderer/helpers/api/local.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Innertube, Session } from 'youtubei.js'
import { Innertube } from 'youtubei.js'
import { join } from 'path'

import { PlayerCache } from './PlayerCache'
Expand All @@ -18,31 +18,19 @@ import { extractNumberFromString, getUserDataPath } from '../utils'
* @returns the Innertube instance
*/
async function createInnertube(options = { withPlayer: false, location: undefined }) {
let cache
if (options.withPlayer) {
const userData = await getUserDataPath()

return await Innertube.create({
// use browser fetch
location: options.location,
fetch: (input, init) => fetch(input, init),
cache: new PlayerCache(join(userData, 'player_cache'))
})
} else {
// from https://github.com/LuanRT/YouTube.js/pull/240
const sessionData = await Session.getSessionData(undefined, options.location)

const session = new Session(
sessionData.context,
sessionData.api_key,
sessionData.api_version,
sessionData.account_index,
undefined, // player
undefined, // cookies
(input, init) => fetch(input, init) // use browser fetch
)

return new Innertube(session)
cache = new PlayerCache(join(userData, 'player_cache'))
}

return await Innertube.create({
retrieve_player: !!options.withPlayer,
location: options.location,
// use browser fetch
fetch: (input, init) => fetch(input, init),
cache
})
}

let searchSuggestionsSession = null
Expand Down
2 changes: 2 additions & 0 deletions static/locales/ru.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,8 @@ Settings:
Hide Upcoming Premieres: Скрыть предстоящие премьеры
Hide Channels Placeholder: Название или идентификатор канала
Hide Channels: Скрыть видео с каналов
Display Titles Without Excessive Capitalisation: Отображать заголовки без чрезмерного
использования заглавных букв
The app needs to restart for changes to take effect. Restart and apply change?: Чтобы
изменения вступили в силу, необходимо перезапустить приложение. Перезапустить
и применить изменения?
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9244,10 +9244,10 @@ yocto-queue@^0.1.0:
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==

youtubei.js@^2.6.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/youtubei.js/-/youtubei.js-2.6.0.tgz#7ba11f0d81b2e8d76a0993524b98ca7554d1090a"
integrity sha512-QnpOdcCqikI5qVTmMY7Orx/CglNVfsP+OGUgavodX20MtSRYUqjR/s/HYo1vWAol1hZT+PThEnIUrX/6U9IueA==
youtubei.js@^2.7.0:
version "2.7.0"
resolved "https://registry.yarnpkg.com/youtubei.js/-/youtubei.js-2.7.0.tgz#2b980f3e97c9b05097d3b387ff4f6a8d42a61e0d"
integrity sha512-npMhgWSru/tPdHvUUqgc0UZv9J7nn/o2V9cfcMS2WvnjhHW9vc9wR54QxyNxURC3uFKkk5WBouu+QjMn+bMtwg==
dependencies:
"@protobuf-ts/runtime" "^2.7.0"
jintr "^0.3.1"
Expand Down

0 comments on commit 78be5e9

Please sign in to comment.