This Flask API provides an endpoint to retrieve PetitTube URL, YouTube title, and views for a video. Try out the demo here.
Follow the instructions below to set up and run the API.
-
Python 3.x
-
Install required Python packages using the following command:
pip install -r requirements.txt
-
Clone the repository:
-
Navigate to the project directory:
cd petite-tube-wrapper-api
-
Run the Flask app:
python app.py
The API will be accessible at
http://127.0.0.1:5000/
.
-
Method: GET
-
Description: Display documentation for the PetitTube API.
-
Example:
Open your web browser and navigate to
http://127.0.0.1:5000/
to view the documentation.
-
Method: GET
-
Description: Retrieve PetitTube URL, YouTube title, and views.
-
Example:
Make a GET request to
http://127.0.0.1:5000/geturl
to get information about the PetitTube video.{ "petittube_url": "https://www.youtube.com/embed/example_video_id", "youtube_title": "Example YouTube Title", "views": 12345 }
- Flask: Web framework for building the API.
- Requests: HTTP library for making requests to external websites.
- BeautifulSoup4: HTML parsing library for extracting data from HTML content.
- pytube: Library for downloading YouTube videos and extracting information.
Feel free to contribute by opening issues or creating pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
- Flask: Web framework for Python.
- Requests: HTTP library for Python.
- Beautiful Soup: HTML parsing library for Python.
- pytube: Library for downloading YouTube videos.
- PetitTube: Source of least interesting videos on YouTube.