Closed BillionShields closed 6 months ago
Hi @BillionShields, thank you for your suggestion! Could you please elaborate what the usecase for this is and why you think this would be a good change? This would break the current API and I don't really see how this would add enough value to warrant a breaking change. Since you know the ID of the video you are retrieving the transcript for, the URL can easily be deduced anyways, so you wouldn't need this module to retrieve the URL. For retrieving the title, there are plenty of other ways to do to that. I try to keep the scope of this module concise (subtitles/transcript), so I am generally not too fond of adding retrieval of metadata which is out of that scope, unless I see a good usecase within that scope, which requires that data.
Would you accept a PR change request for an additional param which parses the response and returns a concise extracted information?
@graphicmist If you can propose a solution which doesn't break the current API and doesn't need additional requests, I would consider it.
@jdepoix Any option to provide it a youtube video link instead of video_Id, Anyways how to use video_id?
@xts-bit I don't think your question is related to this issue.
This module only works with video IDs, not with URLs. You can easily parse the video ID out of the youtube URL. However, there are many different ways YouTube URLs can be structured and I don't think it should be part of this module to support them all. For most use cases you will only work with one format anyways so it is much more reliable if you as the user of the module parse the ID as required for your usecase. For example, it could look something like this:
from urllib.parse import urlparse, parse_qs
video_url = "https://www.youtube.com/watch?v=video123"
video_id = parse_qs(urlparse(video_url).query).get("v")
Closed due to inactivity
Discussed in https://github.com/jdepoix/youtube-transcript-api/discussions/216