
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
YTubeInsight is a Python package for effortless YouTube channel analytics. Track video counts, extract details, and gain insights from YouTube channels with ease.
You can install YTubeInsight using pip. We recommend using a virtual environment to manage your dependencies. You can choose between venv (built into Python) or conda based on your preference.
Create a virtual environment:
python -m venv ytubeinsight-env
Activate the virtual environment:
ytubeinsight-env\Scripts\activate
source ytubeinsight-env/bin/activate
Install YTubeInsight:
pip install ytubeinsight
Create a conda environment:
conda create --name ytubeinsight-env python=3.8
Activate the conda environment:
conda activate ytubeinsight-env
Install YTubeInsight:
pip install ytubeinsight
Here's a simple example of how to use YTubeInsight:
from ytubeinsight import analyze_channel
# Replace with your YouTube Data API key
API_KEY = 'YOUR_API_KEY_HERE'
# Analyze a channel by URL
channel_url = 'https://www.youtube.com/channel/UC_x5XG1OV2P6uZZ5FSM9Ttw'
result = analyze_channel(channel_url, API_KEY)
print(f"Videos published in the last year: {result['video_count']}")
# Print details of the first video
if result['video_data']:
video = result['video_data'][0]
print(f"Latest video:")
print(f"Title: {video['title']}")
print(f"Published on: {video['published_at']}")
print(f"URL: {video['url']}")
from ytubeinsight import analyze_channel
result = analyze_channel('https://www.youtube.com/channel/UC_x5XG1OV2P6uZZ5FSM9Ttw', 'YOUR_API_KEY')
from ytubeinsight import analyze_channel
result = analyze_channel('UCJFp8uSYCjXOMnkUyb3CQ3Q', 'YOUR_API_KEY', is_channel_id=True)
from ytubeinsight import analyze_channel, YTubeInsightError
try:
result = analyze_channel('invalid_channel_url', 'YOUR_API_KEY')
except YTubeInsightError as e:
print(f"An error occurred: {str(e)}")
Analyzes a YouTube channel and returns video data for the past year.
channel_input
: Either a full channel URL or channel IDapi_key
: YouTube Data API keyis_channel_id
: Boolean indicating if channel_input is a channel IDReturns a dictionary containing:
video_count
: Number of videos published in the last yearvideo_data
: List of dictionaries, each containing video details (title, publish date, URL)For more detailed API documentation, please visit our Read the Docs page.
To use YTubeInsight, you need a YouTube Data API key. Here's how to get one:
Remember to keep your API key secret and never share it publicly.
To set up the development environment:
Clone the repository:
git clone https://github.com/FahimFBA/YTubeInsight.git
cd YTubeInsight
Create and activate a virtual environment (choose one):
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
conda create --name ytubeinsight-dev python=3.8
conda activate ytubeinsight-dev
Install the development dependencies:
pip install -e .[dev]
Run the tests:
pytest
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Please make sure to update tests as appropriate and adhere to the Code of Conduct.
This project is licensed under the MIT License - see the LICENSE file for details.
For a detailed changelog, please see the CHANGELOG.md file.
If you encounter any problems or have any questions, please open an issue on GitHub.
This project is not affiliated with, authorized, maintained, sponsored or endorsed by YouTube or any of its affiliates or subsidiaries. This is an independent and unofficial API. Use at your own risk.
FAQs
A Python package for YouTube channel analytics
We found that ytubeinsight demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.