64 Commits

Author SHA1 Message Date
964b99ea40
Fix comment replies not working
YouTube set a limit of 200 replies, otherwise it rejects the
request. So decrease the requested number of replies to 200
2024-01-22 06:00:49 +08:00
Jesus E
cd7624f2cb
Set hqdefault thumnail images 2023-06-18 19:45:34 -04:00
16f81de968
[comments]: pep8 2021-08-10 18:14:05 -05:00
0e896cbf34
[comments_info]: relax traceback message 2021-08-10 17:28:45 -05:00
James Taylor
3dee7ea0d1
Switch to new comments api now that old one is being disabled
watch_comment api periodically gives the error "Top level
comments mweb servlet is turned down."

The continuation items for the new api are in a different
arrangement in the json, so changes were necessary to the
extract_items function.

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-08-09 12:10:42 -05:00
James Taylor
bee14ea9ea
Comments: Fix exceptions when ctoken metadata are missing (None)
Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-08-09 12:00:18 -05:00
7fd2c3474f
Capitalize name app 2021-06-10 16:41:45 -05:00
James Taylor
a9edc54aac
Use extract_approx_int for comment likes
Full digits no longer available

Closes #64

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-06-10 12:47:09 -05:00
4a5b336deb
minor fix 2021-02-26 12:15:02 -05:00
James Taylor
1ec02199ea
Update max_replies when there's a continuation for the replies
Because of the new ctoken methodology for getting comment replies,
the more comments button automatically works inside the comment
reply thread when there are more replies than the limit (250).

This commit also updates the max_replies for that ctoken so the
next 250 replies will be retrieved for the more comments ctoken.

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-02-26 12:11:32 -05:00
James Taylor
00ef1c8627
Fix comment replies
Comment reply protobuf now requires the channel id of the uploader
of the video. Otherwise the endpoint returns 500.

Instead of making the protobuf ourselves and passing this data
around through query parameters, just use the ctoken provided to us
but modify the max_replies field from 10 to 250.

Fixes #53

Signed-off-by: Jesús <heckyel@hyperbola.info>
2021-02-26 11:39:23 -05:00
056c3be3f2
strip_non_ascii in comments-author-name 2020-12-30 00:04:41 -05:00
James Taylor
dcfa2700ef
request_comments: remove obsolete retrying code
The issue that code was working around happened with an older
request format (the ajax format) that was removed. The issue
does not happen with the newer polymer format.

Signed-off-by: Jesús <heckyel@hyperbola.info>
2020-12-21 21:28:17 -05:00
James Taylor
84c6192e08
video_comments: print error string in console
Signed-off-by: Jesús <heckyel@hyperbola.info>
2020-12-21 21:17:47 -05:00
b9a3082e7c
pep8 2020-12-15 21:52:04 -05:00
James Taylor
b126ce1aa6 Video comments: replace with error message if there is error
Such as 429 error, or an exception
2020-11-29 18:56:22 -08:00
James Taylor
2ac806f9eb video comments: add link to open the comments page separately
for situations where the comments failed to load
2020-11-29 15:54:04 -08:00
James Taylor
d3230e8daf Remove commenting system. Because:
- Actually using it will result in comments being shadowbanned,
  even those posted from Youtube's interfacs, because your account
  gets downranked since no analytics are present so it looks like a
  bot posting the comment.
- It's been broken for awhile
2020-10-21 19:58:31 -07:00
James Taylor
75e8930958 yt_data_extract: normalize thumbnail and author urls
for instance, urls that start with // become https://

adjustment required in comments.py because the url was left as a
relative url in yt_data_extract by mistake and was using URL_ORIGIN
prefix as fix.

see #31
2020-10-19 12:55:03 -07:00
James Taylor
fd253d9e07
Merge branch 'master' into optional_proxy_images 2020-10-12 09:37:13 -07:00
zrose584
643a0e8659 remove trimming of comment likes 2020-10-11 16:28:30 +02:00
zrose584
debc11931f add comments.js 2020-10-07 20:32:57 +02:00
zrose584
f8d9be2d5a settings.py: add 'proxy_images' 2020-10-07 19:28:52 +02:00
James Taylor
56e7751da7 Fix failure to parse comments when there's one from deleted channel
Specifically, fix failures when any of the fields from the parsed
comment are None, such as author, author_url, etc.
(failure due to string concatenation when building urls).
2020-03-08 16:17:04 -07:00
James Taylor
beb0976b5b Extraction: Rewrite comment extraction, remove author_id and rename author_channel_id to that, fix bug in extract_items
author_id (an internal sql-like integer previously required for deleting and editing comments) has been removed by Youtube and is no longer required.
Remove it for simplicity.
Rename author_channel_id to author_id for consistency with other extraction attributes.
extract_items returned None for items instead of [] for empty continuation responses. Fixes that.
2019-12-19 15:50:19 -08:00
James Taylor
98777ee825 Extraction: Rewrite item_extraction for better error handling and readability, rename extracted names for more consistency 2019-12-18 19:39:16 -08:00
James Taylor
61c50e0b54 Extraction: Move comment extraction to yt_data_extract 2019-09-19 11:41:16 -07:00
James Taylor
ba0809b965 rename enable_comments amd enable_related_videos 2019-08-01 00:28:51 -07:00
James Taylor
e00c3cf99f Remove ad-hoc response saving from code, create a debug setting for fetch_url 2019-07-23 23:57:45 -07:00
James Taylor
fc295ac93d Convert comment posting system to flask framework 2019-07-21 21:48:54 -07:00
James Taylor
8cad77ad0d Convert comments to flask framework 2019-07-19 22:27:10 -07:00
James Taylor
9f93b9429c Fix comment parsing error due to comments from deleted channels 2019-05-09 23:07:43 -07:00
James Taylor
b32330be4f refactor common.py into 3 files 2019-02-21 21:32:31 -08:00
James Taylor
36e0409db4 Add newline to end of files 2019-01-06 18:20:29 -08:00
James Taylor
bb2d40ac83 rename env['fields'] to env['parameters'] and rename fields to parameters in general 2019-01-06 01:33:52 -08:00
James Taylor
a57fc77426 WSGI for simple non-path GET pages 2019-01-05 00:20:39 -08:00
James Taylor
ea0705a98d Add permalink to comment on timestamp 2019-01-02 21:42:14 -08:00
James Taylor
e3fac7da54 Ability to delete comments 2018-12-31 02:52:27 -08:00
James Taylor
005c1239a6 Rename username to channel_id in more places 2018-12-31 00:00:06 -08:00
James Taylor
913c258093 Use channel id to uniquely identify accounts, not username 2018-12-30 23:27:51 -08:00
James Taylor
ca37786e38 Fix username parameter not being sent 2018-12-26 20:12:55 -08:00
James Taylor
fcbd8ebef6 Added account selection to comment boxes 2018-12-26 19:37:15 -08:00
James Taylor
75b0c52f57 Ability to sort channel videos by oldest and by views 2018-12-17 02:24:55 -08:00
James Taylor
409fea0197 Use post/redirect/get method to prevent form resubmission for comments 2018-11-10 21:13:49 -08:00
James Taylor
ac9fbbbf10 comments: fixed regression in previous comments bugfix commit 2018-10-18 01:45:31 -07:00
James Taylor
697d6e3583 fix error parsing comments when a comment has all replies in a thread 2018-10-16 13:18:56 -07:00
James Taylor
03f5ccbacb add support for lc parameter 2018-10-01 17:58:35 -07:00
James Taylor
6c61472daf Display latency/read-time for comment retrieval 2018-09-15 17:54:12 -07:00
James Taylor
5f4d4e0499 single comment retrieval function, remove left-over debug writing 2018-09-07 13:49:45 -07:00
James Taylor
ffeccc5ac3 Reorganize comment system 2018-09-01 21:53:40 -07:00