youtube icon indicating copy to clipboard operation
youtube copied to clipboard

[Idea] copy YouTube video transcriptions efficiently

Open 0uros opened this issue 2 years ago • 18 comments

PROBLEM: Many times, I want to copy the transcription of a YouTube video, but I have to manually select all the text in the video to be able to copy it, making it time-consuming and tedious when dealing with multiple videos (this is useful for sending it to some AI).

SOLUTION:
Add an option to quickly copy everything in a transcription, like a button, either in the transcription section itself or elsewhere in the UI.

ALTERNATIVES: Some way to automatically select all the text in transcriptions.

RELEVANCE / SCOPE: Scope is complicated to measure; it's something I don't think many people are actively looking for, but at the same time, it's something I haven't seen anyone develop, so it could be niche, but it could also be the first and only solution to that niche problem or situation.

"SIDE EFFECTS":
I don't believe anyone would be bothered by an easier way to do something that can already be done.

SHORT Table (Summary)
Problem Want to copy YouTube video transcriptions efficiently.
Solution Add a quick "Copy All" option in the transcription section.
Alternatives Provide automatic text selection in transcriptions.
Scope Niche problem; potential unique solution.
Side effects Unlikely to bother users.

0uros avatar Sep 12 '23 01:09 0uros

The idea is good, i would like to work on this, can anyone assign me?

asifurrahaman754 avatar Sep 25 '23 15:09 asifurrahaman754

@ImprovedTube any suggestion as to how can I get started with the codebase? I have read the wiki and discussion but didn't find a straightforward guide to get started, I might miss something important. Would really help if you can tell

asifurrahaman754 avatar Sep 25 '23 16:09 asifurrahaman754

hi @asifurrahaman754! i regret the delay, you can join us on discord too.

  • We have some global variables & regex here: https://github.com/code-charity/youtube/blob/bdc9e0ea6d8113d3514ef22f8657473ae9622032/js%26css/web-accessible/core.js#L4 https://github.com/code-charity/youtube/blob/bdc9e0ea6d8113d3514ef22f8657473ae9622032/js%26css/web-accessible/core.js#L32-L40

  • We observe the DOM for changes to apply features as soon as certain elements appear https://github.com/code-charity/youtube/blob/bdc9e0ea6d8113d3514ef22f8657473ae9622032/js%26css/web-accessible/functions.js#L5

  • We observe changes of settings, so that we can call the feature with no page-reload (or possibly an introductory animation, or undo a feature when it is switched off) https://github.com/code-charity/youtube/blob/bdc9e0ea6d8113d3514ef22f8657473ae9622032/js%26css/web-accessible/core.js#L168

  • We have our extension popup's GUI & re-purposable functions in our little library https://github.com/code-charity/SATUS

ImprovedTube avatar Sep 28 '23 15:09 ImprovedTube

most features can be developed indepently of the rest @asifurrahaman754

(this one might not be one line, while #1774 could be near the minimum.)

thank you again!

ImprovedTube avatar Sep 28 '23 15:09 ImprovedTube

most features can be developed indepently of the rest @asifurrahaman754

of course this one might not be e smallest webdev task found in #good-first-issue, while #1774 should be near the minimum.

thank you again!

Thanks for your help

asifurrahaman754 avatar Sep 28 '23 15:09 asifurrahaman754

I think this could be incredibly useful for things like asking ChatGPT for video summaries. I would love to see this implemented.

ElmorenohWTF avatar Oct 11 '23 18:10 ElmorenohWTF

@ImprovedTube please review the pr and please add "hacktoberfest-accepted" on that pr.

asifurrahaman754 avatar Oct 15 '23 09:10 asifurrahaman754

@0uros enjoy the feature

asifurrahaman754 avatar Oct 17 '23 08:10 asifurrahaman754

@asifurrahaman754 Thanks! The feature has already been implemented? Under what name can I search for it or where it is located?

0uros avatar Oct 18 '23 16:10 0uros

@0uros you can find it Appearance -> Details -> Copy transcript

asifurrahaman754 avatar Oct 18 '23 16:10 asifurrahaman754

@asifurrahaman754 atm I don't see the option (version 4.355) :P

Thanks anyway, I hope to use the feature soon

0uros avatar Oct 18 '23 20:10 0uros

@0uros the feature is approved, maybe they didn't add it yet

asifurrahaman754 avatar Oct 19 '23 03:10 asifurrahaman754

hi @0uros you can test the github repo version https://github.com/code-charity/youtube/archive/master.zip it can also be uploaded to the stores too with the next update, besides it didnt work here just yet.

  • Also Google asks for a reason for the "tabs" permission (possibly longer review time).
    And I think WebStore's alert on installation will say that the extension accesses browser history? (and disable it at update everybody until users agree. - So while we probably need the tabs permission for many reasons at one point in future, we might not require it today. (permissions can also be requested optionally the first time a feature is used)

    • Yet our other buttons for screenshot or ImprovedTube Icon itself appear on the Youtube page. So this should be an option. @asifurrahaman754.

      • Existing positions:
        • player controls : https://github.com/code-charity/youtube/blob/d8733eaf2037f084078d52aaf5df34cd7253690e/js%26css/web-accessible/www.youtube.com/player.js#L547
        • header, draggable, ...https://github.com/code-charity/youtube/blob/d8733eaf2037f084078d52aaf5df34cd7253690e/js%26css/web-accessible/www.youtube.com/settings.js#L6
        • below player https://github.com/code-charity/youtube/blob/d8733eaf2037f084078d52aaf5df34cd7253690e/js%26css/web-accessible/www.youtube.com/appearance.js#L316
      • We can also offer an option to make it appear position:absolute or position:fixed (this still works when youtube changes and avoid bugs like here: https://github.com/code-charity/youtube/issues/1544 https://github.com/code-charity/youtube/blob/d8733eaf2037f084078d52aaf5df34cd7253690e/js%26css/web-accessible/www.youtube.com/playlist.js#L23 )
    • The way you started will be nice too. We can put some buttons on the front screen of the popup, to make it efficient (two clicks)

ImprovedTube avatar Oct 19 '23 06:10 ImprovedTube

@ImprovedTube I also thought that I could add a copy button in the youtube description. that way the user can easily copy the transcript in just one click. what do you think about that?And about the tab permission, i needed that. I am not sure if i can do that without the tab permission. If you have anything, please suggest

asifurrahaman754 avatar Oct 22 '23 17:10 asifurrahaman754

hi! @asifurrahaman754

  • when removing the <span>'s we can add line breaks \r\n
  • consider transcripts also do have headlines in between
  • when opened the transcripts look like <div id="header> <ytd-transcript-segment-renderer> <yt-formatted-string ...> ... </ytd-transcript-segment-renderer>

also thought that I could add a copy button in the youtube description

also can be the 4th one here:

  • below player https://github.com/code-charity/youtube/blob/d8733eaf2037f084078d52aaf5df34cd7253690e/js%26css/web-accessible/www.youtube.com/appearance.js#L316

I am not sure if i can do that without the tab permission.

why? this part looks optional:

const YOUTUBE_WATCH_URL = "https://www.youtube.com/watch?v"; chrome.runtime.onMessage.addListener( function(request) { if (request.action === "copyTranscript" && request?.tab?.url.startsWith(YOUTUBE_WATCH_URL)){ copyTranscript(); }else if(request.action === "copyTranscript" && !request?.tab?.url.startsWith(YOUTUBE_WATCH_URL)){ alert('This feature is only available on YouTube video pages.'); } } );

thanks!

ImprovedTube avatar Oct 23 '23 08:10 ImprovedTube

Any news? 😅

0uros avatar Dec 26 '23 21:12 0uros

hi @0uros, hopefully soon! (entertianing? : https://github.com/code-charity/youtube/issues/1568#issuecomment-1870934393 )

happy 2024 @asifurrahaman754 ♡

ImprovedTube avatar Dec 28 '23 08:12 ImprovedTube

Hoping to be able to download/copy full transcripts was the main reason I installed the add-on so I'd love to see it added.

ThoughtPhotography avatar May 15 '24 12:05 ThoughtPhotography

hi! and thanks @CATIOR (#2467)

this work is still pending to be finished:
https://github.com/code-charity/youtube/pull/1792

ImprovedTube avatar Jul 09 '24 03:07 ImprovedTube