- 
                Notifications
    
You must be signed in to change notification settings  - Fork 5.5k
 
[New Component] Gistly YouTube Transcript API #14763
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
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            17 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      8e7ddba
              
                - add Gistly YouTube Transcript API component
              
              
                rafalzawadzki 1c42061
              
                - lint
              
              
                rafalzawadzki 7937da8
              
                - add Gistly YouTube Transcript API component
              
              
                rafalzawadzki 9e22e01
              
                - lint
              
              
                rafalzawadzki 0838429
              
                Update components/gistly/gistly.app.mjs
              
              
                rafalzawadzki 4ee6d58
              
                Update components/gistly/package.json
              
              
                rafalzawadzki 975fdaf
              
                Update components/gistly/gistly.app.mjs
              
              
                jcortes 60fa1f8
              
                - pnpm i
              
              
                rafalzawadzki 45c97e1
              
                Merge branch 'master' of https://github.com/rafalzawadzki/pipedream
              
              
                rafalzawadzki 1d4a47a
              
                - pnpm i
              
              
                rafalzawadzki 1000413
              
                - fix duplicated methods
              
              
                rafalzawadzki 24b3b14
              
                Merge remote-tracking branch 'upstream/master'
              
              
                rafalzawadzki 43334aa
              
                - prettier
              
              
                rafalzawadzki 468c7e0
              
                Merge branch 'master' into master
              
              
                rafalzawadzki db538cc
              
                revert unrelated code style changes
              
              
                rafalzawadzki 1536cbc
              
                Update package.json
              
              
                rafalzawadzki 3973339
              
                Merge branch 'master' into master
              
              
                malexanderlim File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Overview | ||
| 
     | 
||
| Gistly API allows you to fetch transcripts or subtitles from YouTube videos in various formats. It's a powerful tool for integrating video content into your applications, enabling you to process and analyze video transcripts programmatically. | ||
| 
     | 
||
| - Instantly fetch transcripts from a library of billions of YouTube videos | ||
| - Extract accurate and time-stamped video transcripts for content analysis | ||
| - High performance and high availability API for bulk requests | ||
| 
     | 
||
| # API Details | ||
| 
     | 
||
| - **Endpoint**: `GET https://api.gist.ly/youtube/transcript` | ||
| - **Authorization**: Requires an API key in the Authorization header. | ||
| - **Parameters**: | ||
| - `url` or `videoId`: Specify the YouTube video. | ||
| - `text`: Boolean to return plain text transcript. | ||
| - `chunkSize`: Maximum characters per transcript chunk (optional). | ||
| 
     | 
||
                
      
                  jcortes marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| For more details, visit the [Gistly API documentation](https://gist.ly/youtube-transcript-api#doc). | ||
                
      
                  jcortes marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
        
          
          
            55 changes: 55 additions & 0 deletions
          
          55 
        
  components/gistly/actions/get-transcript/get-transcript.mjs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import app from "../../gistly.app.mjs"; | ||
| 
     | 
||
| export default { | ||
| key: "gistly-get-transcript", | ||
| name: "Get Transcript", | ||
| description: | ||
| "Fetches transcript/subtitles from a YouTube video using Gistly API.", | ||
| version: "0.0.1", | ||
| type: "action", | ||
| props: { | ||
| app, | ||
| videoUrl: { | ||
| propDefinition: [ | ||
| app, | ||
| "videoUrl", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| videoId: { | ||
| propDefinition: [ | ||
| app, | ||
| "videoId", | ||
| ], | ||
| optional: true, | ||
| }, | ||
| text: { | ||
| propDefinition: [ | ||
| app, | ||
| "text", | ||
| ], | ||
| }, | ||
| chunkSize: { | ||
| propDefinition: [ | ||
| app, | ||
| "chunkSize", | ||
| ], | ||
| }, | ||
| }, | ||
| async run({ $ }) { | ||
| const params = { | ||
| url: this.videoUrl, | ||
| videoId: this.videoId, | ||
| text: this.text, | ||
| chunkSize: this.chunkSize, | ||
| }; | ||
| 
     | 
||
| const response = await this.app.getTranscript({ | ||
| $, | ||
| params, | ||
| }); | ||
| 
     | 
||
| $.export("$summary", "Successfully fetched the transcript for the video."); | ||
| return response; | ||
| }, | ||
| }; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1,11 +1,56 @@ | ||
| import { axios } from "@pipedream/platform"; | ||
| 
     | 
||
| export default { | ||
| type: "app", | ||
| app: "gistly", | ||
| propDefinitions: {}, | ||
| propDefinitions: { | ||
| videoUrl: { | ||
| type: "string", | ||
| label: "YouTube Video URL", | ||
| description: "The URL of the YouTube video to fetch the transcript from", | ||
| }, | ||
| videoId: { | ||
| type: "string", | ||
| label: "YouTube Video ID", | ||
| description: "The ID of the YouTube video to fetch the transcript from", | ||
| }, | ||
                
      
                  jcortes marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| text: { | ||
| type: "boolean", | ||
| label: "Plain Text", | ||
| description: "Return plain text transcript", | ||
| default: false, | ||
| }, | ||
| chunkSize: { | ||
| type: "integer", | ||
| label: "Chunk Size", | ||
| description: "Maximum characters per transcript chunk", | ||
| optional: true, | ||
| }, | ||
                
      
                  jcortes marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| }, | ||
| methods: { | ||
| // this.$auth contains connected account data | ||
| authKeys() { | ||
| console.log(Object.keys(this.$auth)); | ||
| _apiKey() { | ||
| return this.$auth.api_key; | ||
| }, | ||
| _apiUrl() { | ||
| return "https://api.gist.ly"; | ||
| }, | ||
| _makeRequest({ | ||
| $ = this, path, ...args | ||
| }) { | ||
| return axios($, { | ||
| url: `${this._apiUrl()}${path}`, | ||
| ...args, | ||
| headers: { | ||
| "x-api-key": this._apiKey(), | ||
| "Content-Type": "application/json", | ||
| }, | ||
| }); | ||
| }, | ||
| getTranscript(args = {}) { | ||
| return this._makeRequest({ | ||
| path: "/youtube/transcript", | ||
| ...args, | ||
| }); | ||
| }, | ||
| }, | ||
| }; | ||
| }; | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
      
      Oops, something went wrong.
      
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.