Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: better cross runtime support #97

Merged
merged 89 commits into from
Jul 20, 2022
Merged
Changes from 1 commit
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
0569933
refactor: remove dependancies
Wykerd Jul 11, 2022
34cb9da
refactor!: commonjs to es6
Wykerd Jul 11, 2022
1e7a6f0
refactor!: NToken and Signature TS files
Wykerd Jul 11, 2022
6f4d96f
feat: cross platform cache (WIP)
Wykerd Jul 12, 2022
f622448
feat: EventEmitter polyfill
Wykerd Jul 12, 2022
29fe937
refactor: remove events
Wykerd Jul 12, 2022
5035172
feat: HTTPClient based on Fetch API (WIP)
Wykerd Jul 12, 2022
27965ec
refactor!: parsers refactor (WIP)
Wykerd Jul 12, 2022
3726359
refactor!: parsers refactor (WIP)
Wykerd Jul 12, 2022
dd207df
refactor!: parser refactor
Wykerd Jul 12, 2022
37b8f70
fix: some missed parsers while refactoring
Wykerd Jul 12, 2022
189f152
fix: better type inferance for parseResponse
Wykerd Jul 12, 2022
ac83bad
feat(TS): typesafe YTNode casts
Wykerd Jul 13, 2022
53515fb
feat: more type safety in YTNode and Parser
Wykerd Jul 13, 2022
5a2e465
refactor: VideoInfo download with fetch & TS (WIP)
Wykerd Jul 13, 2022
8fb1924
fix: LiveChat in VideoInfo
Wykerd Jul 13, 2022
76d19b4
refactor!: more typesafety in parser
Wykerd Jul 13, 2022
5c49385
refactor!: VideoInfo almost completed
Wykerd Jul 13, 2022
8f873a5
refactor!: player and session refactors
Wykerd Jul 13, 2022
0392751
refactor!: move auth logic to Session (WIP)
Wykerd Jul 13, 2022
23258dc
refactor: TS port for Actions and Innertube
Wykerd Jul 13, 2022
fc1a403
refactor: NavigationEndpoint TS
Wykerd Jul 13, 2022
c9db56f
refactor!: VideoInfo compiles without errors
Wykerd Jul 13, 2022
e265305
chore: delete old player
Wykerd Jul 13, 2022
e1cae96
fix: import errors
Wykerd Jul 13, 2022
882f471
fix: Utils import fixes
Wykerd Jul 13, 2022
093aebc
fix: several runtime errors
Wykerd Jul 13, 2022
42577ae
fix: video streaming
Wykerd Jul 14, 2022
a851516
chore: remove console.log debugging
Wykerd Jul 14, 2022
98d318a
chore: remove old unused dependencies
Wykerd Jul 14, 2022
59be455
fix: typescript errors
Wykerd Jul 14, 2022
297c856
refactor: TS feed
Wykerd Jul 14, 2022
8cb28ad
chore: delete old Feed
Wykerd Jul 14, 2022
40cb10a
refactor: move streamToIterable into Utils
Wykerd Jul 14, 2022
558027b
refactor: AccountManager TS
Wykerd Jul 14, 2022
8586626
refactor: FilterableFeed to TS
Wykerd Jul 14, 2022
1d60d72
refactor: InteractionManager to TS
Wykerd Jul 14, 2022
061903d
refactor: PlaylistManager to TS
Wykerd Jul 14, 2022
ba9e349
refactor: TabbedFeed to TS
Wykerd Jul 14, 2022
29046f7
refactor: Music to TS (WIP)
Wykerd Jul 14, 2022
3f04c3f
fix: getting the tests to pass (6/12)
Wykerd Jul 14, 2022
50d6ee8
fix: tests (7/12)
Wykerd Jul 14, 2022
4a11ea8
fix: download tests (8/12)
Wykerd Jul 14, 2022
21a37ad
fix: tests (9/12)
Wykerd Jul 14, 2022
b0b4117
feat: key based type validation for parsers
Wykerd Jul 14, 2022
e429471
fix: comments tests pass (10/12)
Wykerd Jul 14, 2022
4b7aa96
refactor: type safety checks removing @ts-ignore
Wykerd Jul 14, 2022
21b87a3
fix: playlist tests pass (11/12)
Wykerd Jul 14, 2022
c7240db
fix: all tests pass for node 🎉
Wykerd Jul 14, 2022
4741b3e
build: working Deno bundle
Wykerd Jul 14, 2022
e888cb5
docs: update deno example to download video
Wykerd Jul 14, 2022
e4b62b2
refactor: MusicResponsiveListItem to TS
Wykerd Jul 14, 2022
5c532ce
docs: TSDoc for Parser helpers
Wykerd Jul 14, 2022
10a96ad
docs: Parser documentation for TS
Wykerd Jul 14, 2022
f597f57
docs: add note about parseItem and parseArray
Wykerd Jul 14, 2022
0f64611
test: remove browser tests since they're identical
Wykerd Jul 14, 2022
d051511
feat: browser support and proxy example
Wykerd Jul 15, 2022
4863c1c
fix: merge conflicts
Wykerd Jul 15, 2022
b3b5f21
fix: PlaylistManager TS after merge
Wykerd Jul 15, 2022
9701b92
feat: in-browser video streaming
Wykerd Jul 15, 2022
f39e73f
refactor: cleanup the Dash example
Wykerd Jul 15, 2022
6507ad2
feat: allow custom fetch implementations
Wykerd Jul 16, 2022
0bafe05
feat: fetch debugger
Wykerd Jul 16, 2022
51bf764
fix: OAuth login
Wykerd Jul 16, 2022
cab9b6c
refactor: remove file extensions from imports
Wykerd Jul 16, 2022
559eacd
refactor: build scripts
Wykerd Jul 16, 2022
9124854
fix: CustomEvent on node
Wykerd Jul 17, 2022
f6ff7c2
fix: LiveChat
Wykerd Jul 17, 2022
0a37abb
fix: linting
Wykerd Jul 17, 2022
2eee3e1
fix: liniting in build-parser-json
Wykerd Jul 17, 2022
679b827
chore: update test workflow
Wykerd Jul 17, 2022
a8a4d7f
fix: NToken errors after lint fixes
Wykerd Jul 17, 2022
76b9927
fix: codacy complaints
Wykerd Jul 17, 2022
77d985d
docs: update to reflect changes
Wykerd Jul 17, 2022
1b2570f
refactor: cleanup imports/exports
Wykerd Jul 17, 2022
79c6ca8
fix: browser example
Wykerd Jul 17, 2022
55b983f
fix: cache on node
Wykerd Jul 17, 2022
d51271b
fix: stupid mistake
Wykerd Jul 17, 2022
fa7d414
refactor: Session#signIn to wait untill success
Wykerd Jul 17, 2022
682261a
refactor: freeze Constants
Wykerd Jul 17, 2022
9682676
refactor: cleanup HTTPClient Request
Wykerd Jul 17, 2022
6b8249b
refactor: debugFetch readability
Wykerd Jul 17, 2022
f4be045
chore: lint
Wykerd Jul 17, 2022
1873f5a
refactor: replace jsdoc with tsdoc eslint plugin
Wykerd Jul 18, 2022
14be811
fix: bunch of liniting warnings
Wykerd Jul 18, 2022
3854d81
refactor: better inference on YTNode#is
Wykerd Jul 18, 2022
e772b86
fix: linting warnings
Wykerd Jul 18, 2022
96e3ed7
revert: undici import
Wykerd Jul 20, 2022
4974a06
refactor: rename `list_type` to `item_type`
Wykerd Jul 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions lib/parser/youtube/VideoInfo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { InnertubeError, ObservedArray } from "../../utils/Utils";
import Parser, { YTNode } from "../index.js";
import LiveChat from "./LiveChat.js";
import LiveChat from "../classes/LiveChat";
Wykerd marked this conversation as resolved.
Show resolved Hide resolved
import Constants from "../../utils/Constants.js";
import Actions from "../../core/Actions";
import Player from "../../core/Player";
Expand All @@ -14,9 +14,6 @@ import ItemSection from "../classes/ItemSection";
import PlayerOverlay from "../classes/PlayerOverlay";
import ToggleButton from "../classes/ToggleButton";
import CommentsEntryPointHeader from "../classes/comments/CommentsEntryPointHeader";
import MetadataRowHeader from "../classes/MetadataRowHeader";
import MetadataRow from "../classes/MetadataRow";
import Text from "../classes/misc/Text";
import ContinuationItem from "../classes/ContinuationItem";

class VideoInfo {
Expand All @@ -40,6 +37,7 @@ class VideoInfo {
watch_next_feed: ObservedArray<YTNode> | null | undefined;
player_overlays;
comments_entry_point_header;
livechat;
/**
* @param data - API response.
* @param actions
Expand Down Expand Up @@ -103,11 +101,7 @@ class VideoInfo {
this.basic_info.is_disliked = Parser.cast_response(this.primary_info?.menu?.top_level_buttons?.get({ icon_type: 'DISLIKE' }), ToggleButton, false)?.is_toggled;
const comments_entry_point = Parser.cast_response(results.get({ target_id: 'comments-entry-point' }), ItemSection, false);
this.comments_entry_point_header = Parser.cast_response(comments_entry_point?.contents?.get({ type: 'CommentsEntryPointHeader' }), CommentsEntryPointHeader, false);
/**
* @type {import('../classes/LiveChat')}
*/
// TODO: this makes no sense, LiveChat is not in the parsers list
// this.livechat = next.contents_memo.getType(LiveChat)?.[0] || null;
this.livechat = next.contents_memo.getType(LiveChat)?.[0] || null;
}
}
/**
Expand Down Expand Up @@ -285,6 +279,7 @@ class VideoInfo {
}
return candidates[0];
}

/**
*
* @param {object} options - download options.
Expand Down