100% found this document useful (2 votes)
2K views

Youtube Video Download Using Python

This document is a project report submitted by Nirmalkumar G for the partial fulfillment of the requirements for a Bachelor of Computer Applications degree. The project developed a YouTube video downloader application using Python. The report includes sections on the existing and proposed systems, software and hardware requirements, and features of Python. The proposed system aims to address drawbacks of existing downloaders like quality loss, malware, unreliability and limited compatibility through obtaining creator permission, preserving quality, ensuring reliability, and improving the user interface. Python was used for its simplicity, multi-platform support, and large standard library.

Uploaded by

VINOTH K
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
2K views

Youtube Video Download Using Python

This document is a project report submitted by Nirmalkumar G for the partial fulfillment of the requirements for a Bachelor of Computer Applications degree. The project developed a YouTube video downloader application using Python. The report includes sections on the existing and proposed systems, software and hardware requirements, and features of Python. The proposed system aims to address drawbacks of existing downloaders like quality loss, malware, unreliability and limited compatibility through obtaining creator permission, preserving quality, ensuring reliability, and improving the user interface. Python was used for its simplicity, multi-platform support, and large standard library.

Uploaded by

VINOTH K
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

YOUTUBE VIDEO DOWNLOADER

A MINI PROJECT REPORT

Submitted in partial fulfillment of the requirements for the award of the degree of

BACHELOR OF COMPUTER APPLICATIONS

Submitted By

NIRMALKUMAR G

Register No. 20UCA228212

Under the Guidance of

Mrs. D. DURGA, MCA,

Guest Lecturer of Computer Applications

DEPARTMENT OF COMPUTER APPLICATIONS

GOVERNMENT ARTS COLLEGE (AUTONOMOUS)

(Re-Accredited by NAAC with B Status) SALEM-636 007


APRIL 2023
CERTIFICATE

This is to certify that the project work entitled “YOUTUBE VIDEO DOWNLOADER”
submitted to Government Arts College (Autonomous), Salem-7. in partial fulfillment requirements
for the award of degree of BACHELOR OF COMPUTER APPLICATIONS is a record of
project work done by [NIRMALKUMAR G ], (Register No : 20UCA228212) between March
2023 under my supervision and guidance.

Date : Signature of the Guide

Place : Salem-7

Head of the Department

Submitted for the Autonomous Viva-Voce Examination held on……………………..

Internal Examiner External Examiner


DECLARATION

I here by declare that the mini project work entitled “YOUTUBE VIDEO
DOWNLOADER” submitted to Government Arts College (Autonomous), Salem-7 in partial
fulfillment of the requirements for the award of degree of BACHELOR OF COMPUTER
APPLICATIONS is a record of original work done by me under the supervision and guidance
of Mrs. D.DURGA, MCA, Guest Lecturer in Department of Computer Applications,
Government Arts College (Autonomous), Salem-7.

Signature of the Candidate

(NIRMALKUMAR G)

REGISTER NUMBER:

20UCA228212

Date:

Place: Salem -7.


ACKNOWLEDGEMENT

At the outset, I would like to thank and honor God who gave me the wisdom and
knowledge to complete this project.

I would like to profusely thank to our college principal


Dr.S. KALAISELVAN, M.Sc., M.Phil., M.Ed., Ph.D. Government Arts College (Autonomous),
Salem-7 for her guidance and encouragement to successfully complete my project.

I express my gratitude Dr. A. KANGAIAMMAL, MCA, M.E, M. Phil, Ph.D. Head of


the Department of Computer Applications, Government Arts College (Autonomous), Salem-7 for
being an unfailing source of inspiration and encouragement.

I would like to express my gratitude and sincere thanks to my guide of Mrs. D. DURGA,
MCA, guest lecture, Department of Computer Application, Government Arts College
(Autonomous), Salem-7 for her source of guidance and suggestions throughout the project.

I express my sincere thanks to all other staff members of computer application department
for this supporting help.

This acknowledgement will be incomplete without expressing my thanks to my parents and


friends for their constant support and encouragement.
CONTENTS
INTRODUCTION
1.1 PROJECT DESCRIPTION:

YOUTUBE VIDEO DOWNLODER


ABSTRACT

In order to form a clear sketch of this project, here's a brief introduction of the
features and scope of YouTube Video Downloader. This project consists of three modules which are
inter-linked to each other. Each of the above modules has certain specific task to perform. Tkinter is
the standard GUI library for Python. Python when combined with Tkinter provides a fast and easy way
to create GUI applications. Tkinter provides a powerful object- oriented interface to the Tk GUI toolkit.
Tkinter provides various controls, such as buttons, labels and text boxes used in a GUI application.
These controls are commonly called widgets.Pytube library makes the video downloading very easy.
Create the object of the YouTube module by passing the link as the parameter. Then, get the
appropriate extension and resolution of the video. You can set the name of the file as your convenience,
in another case original name will be kept. After that, download the file using the download function
which has one parameter which is the location where to download the file. Python, this task is very
easy. Few lines of code will download the video from YouTube for you.

Front-End: PYTHON

Back-End: PYTHON

OBJECTIVE:

1. YouTube downloader tools offer fast speed downloading


2. To download multiple videos or playlist
3. The majority of YouTube downloaders allow users to download the entire playlist in a
single click.
2. SYSTEM ANALYSIS

2.1 EXISTING SYSTEM

Online YouTube Video Downloaders: These are web-based tools that allow users to
download YouTube videos by simply pasting the video URL into the download box. Some popular
examples of online YouTube video downloaders include Y2Mate, Keep Vid , and Clip Converter.
Browser Extensions: There are various browser extensions available for Google Chrome, Mozilla
Firefox, and other web browsers that allow users to download YouTube videos with ease. Some
popular extensions include Video Download Helper and Fastest Tube. Desktop Software: There are
several desktop software options available that allow users to download YouTube videos to their
computer. Some popular software include 4K Video Downloader, Free YouTube Downloader, and
WinX YouTube Downloader.

2.1.1 DRAWBACKS OF EXISTING SYSTEM

1. Quality Loss.
2. Malware and Viruses.
3. Unreliable.
4. Limited Compatibility.

2.2 PROPOSED SYSTEM


This may involve obtaining permission from video creators before allowing users to download
their content. To ensure the best user experience, it's important to prioritize quality preservation in any proposed
system. This may involve using advanced compression algorithms to minimize quality loss during the
download process. Users depend on YouTube video downloaders to work consistently and reliably. Any
proposed system should undergo rigorous testing to ensure that it works well across different devices and
operating systems. A user-friendly interface can help ensure that users can easily navigate and use the system.
This may involve designing an intuitive download process and providing clear instructions for users.
2.2.1 ADVANTAGES OF PROPOSED SYSTEM
1. Legality and Ethics
2. Quality preservation
3. Reliability
4. User Interface

2.3 . SYSTEM REQUIREMENTAND SPECIFICATION

2.3.1 SOFTWARE REQUIRMENTS:

Software is a group of programs that computers need to do a particular task.


Itis an essential requirement of Computer system.

The Software used to develop the project is

➢ Operating System : Windows 10


➢ Front-End : PYTHON
➢ Back-End : PYTHON

2.3.2 HARDWARE REQUIRMENT

The Hardware of the computer consists of physical component such as Input


Devices, Storage Devices, Processing & Control units and Output Devices. Computer includes
external storage unit to store data in programs.

The Hardware Configuration involved in this project.

➢ Platform : Windows10
➢ Processor : AMD PRO A4-350B R4, 5 COMPUTE CORES2C +
3G
➢ CPU Speed : 2.50 GHz
➢ RAM : 4 GB
➢ Hard Disk : 210 GB
2.3.3 SOFTWARE DESCRIPTION

Python is a popular programming language. It was created by Guido van Rossum. and released in
1991.Python was designed for readability, and has some similarities to the English language with
influence from mathematics. Python uses new lines to complete a command, as opposed to other
programming languages which often use semicolons or parentheses. Python relies on indentation,
using whitespace, to define scope; such as the scope of loops. functions and classes. Other
programming languages often use curly-brackets for this purpose.

• Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc).

• Python has a simple syntax similar to the English language.

• Python has syntax that allows developers to write programs with fewer lines than some other
programming languages.

• Python runs on an interpreter system, meaning that code can be executed as soon as it is
written. This means thatprototyping can be very quick.

• Python can be treated in a procedural way, an object- oriented way or a functional way.

FEATURES OF PYTHON:
Easy to Learn and Use: Python has a simple syntax and structure that makes it easy to learn and use,
even for beginners.

Interpreted: Python is an interpreted language, which means that it can execute code directly without
the need for compilation. This makes it easier to test and debug code.

Multi-Platform Support: Python code can be run on a wide range of platforms, including Windows,
Linux, and macOS.
Large Standard Library: Python comes with a large standard library that includes modules for a wide
range of applications, from web development to scientific computing.

Third-Party Libraries and Frameworks: Python has a large and active community of developers who
contribute to open-source libraries and frameworks, making it easy to find resources and support for building
and maintaining Python applications.
SYSTEM DESIGN AND
DEVELOPMENT
3.1 SYSTEM DESIGN AND DEVELOPMENT
3.1 DATA FLOW DIAGRAM

START

Get video URL

Paste Video URL

Extract video ID

Download Fetched video

Save file to directory

END
3.2 MODULE DESCRIPTION
The project having two categories there are

1. File
1. Downloader
2. Mode
3. Help
4. Exit

File
A file description refers to a summary or a detailed explanation of the content, purpose, and structure of
a file. It is often used to provide context and help users understand the contents

Downloader
A video downloader is a type of downloader software that is specifically designed to download video
content from websites

Mode
Light mode and dark mode are two different display modes available in software applications and
devices that allow users to switch between light and dark color schemes.

Help
Help is a type of assistance or support provided to individuals who are in need of guidance, information,
or instruction.

Exit
Exit is a command or action that allows a user to close or terminate a program, application, or system.
3.3 SYSTEM DESIGN

Definition

The most creative and challenging face of the system development is System Design. It
provides the understanding and procedural details necessary for the logical and physical stages of
development. In designing a new system, the system analyst must have a clear understanding of
the objectives, which the design is aiming to fulfill. The first step is to determine how the output
is to be produced and in what format. Second, input data and master files have to be designed to
meet the requirements of the proposed output. The operational phases are handled through program
construction and testing.

3.4 Input Design

In this software, importance is given to develop Graphical User Interface (GUI), which is
an important factor in developing efficient and user friendly software. For inputting user data,
attractive forms are designed. User can also select the desired options from the menu, which
provides all possible facilities. Also the important input format is designed in such a way that
accidental errors are avoided. The user has to input only just the minimum data required, which
also helps in avoiding the errors that the users may make. Accurate designing of the input format
is very important in developing efficient software. The goal of input design is to make entry as
easy, logical and free from errors.

3.5 Output Design

In the output design, the emphasis is on producing a hard copy of the


format. Two of the most output media
today are printers and the screen. Most users now access their reports from either a hard copy or
screen display. Computer’s output is the most important and direct source of information to the
user, efficient, logical, output design should improve the systems relations with the user and help
in decision-making.
SAMPLE OUTPUT:
FILES:

ABOUT:
Light mode:

YouTube video link:


Contact us:

Gathering URL:
File Directory:

Video Fetching:
Path setting:

Downloader:
Exit:
3.6 Code Design

Asgi.py
"""
ASGI config for djangoProject project.

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see


https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoProject.settings')

application = get_asgi_application()

settug.py
"""
Django settings for djangoProject project.

Generated by 'django-admin startproject' using Django 3.1.1.

For more information on this file, see


https://docs.djangoproject.com/en/3.1/topics/settings/

For the full list of settings and their values, see


https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib import Path
import os
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent

# Quick-start development settings - unsuitable for production


# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!


SECRET_KEY = '#r*6fh@d&_-_$=xai$jky0h^n(+y4s5jiu-4&w^1dkz=ex(7g2'

# SECURITY WARNING: don't run with debug turned on in production!


DEBUG = True

ALLOWED_HOSTS = ['*']

# Application definition

INSTALLED_APPS = [
'ytdl',
'crispy_forms',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'djangoProject.urls'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR / 'templates']
,
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'djangoProject.wsgi.application'

# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'test',
}
}

# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]

# Internationalization
# https://docs.djangoproject.com/en/3.1/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True
USE_L10N = True

USE_TZ = True

# Static files (CSS, JavaScript, Images)


# https://docs.djangoproject.com/en/3.1/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static_serve', 'static_root')

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'static_serve', 'media_root')

STATICFILES_DIRS = [os.path.join(BASE_DIR, "static_files")]


STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'

CRISPY_TEMPLATE_PACK = 'bootstrap4'

# CORS_REPLACE_HTTPS_REFERER = False
# HOST_SCHEME = "http://"
# SECURE_PROXY_SSL_HEADER = None
# SECURE_SSL_REDIRECT = False
# SESSION_COOKIE_SECURE = False
# CSRF_COOKIE_SECURE = False
# SECURE_HSTS_SECONDS = None
# SECURE_HSTS_INCLUDE_SUBDOMAINS = False
# SECURE_FRAME_DENY = False
URL.py
"""djangoProject URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from ytdl import views

urlpatterns = [
path('', views.download_video),
]

Wagi.py
"""
WSGI config for djangoProject project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see


https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoProject.settings')

application = get_wsgi_application()

Manage.py
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys

def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoProject.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)

if __name__ == '__main__':
main()
VIEW.PY
from django.shortcuts import render

# Create your views here.


from django.http import HttpResponse
from django.shortcuts import render
import youtube_dl
from .forms import DownloadForm
import re

def download_video(request):
global context
form = DownloadForm(request.POST or None)

if form.is_valid():
video_url = form.cleaned_data.get("url")
regex = r'^(http(s)?:\/\/)?((w){3}.)?youtu(be|.be)?(\.com)?\/.+'
if not re.match(regex,video_url):
return HttpResponse('Enter correct url.')

ydl_opts = {}
try:
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
meta = ydl.extract_info(
video_url, download=False)
video_audio_streams = []
for m in meta['formats']:
file_size = m['filesize']
if file_size is not None:
file_size = f'{round(int(file_size) / 1000000,2)} mb'

resolution = 'Audio'
if m['height'] is not None:
resolution = f"{m['height']}x{m['width']}"
video_audio_streams.append({
'resolution': resolution,
'extension': m['ext'],
'file_size': file_size,
'video_url': m['url']
})
video_audio_streams = video_audio_streams[::-1]
context = {
'form': form,
'title': meta.get('title', None),
'streams': video_audio_streams,
'description': meta.get('description'),
'likes': f'{int(meta.get("like_count", 0)):,}',
'dislikes': f'{int(meta.get("dislike_count", 0)):,}',
'thumb': meta.get('thumbnails')[3]['url'],
'duration': round(int(meta.get('duration', 1))/60, 2),
'views': f'{int(meta.get("view_count")):,}'
}
return render(request, 'home.html', context)
except Exception as error:
return HttpResponse(error.args[0])
return render(request, 'home.html', {'form': form})
TESTING AND IMPLEMENTATION
4. TESTING AND IMPLEMENTATION

4.1 SYSTEM TESTING

System testing is the state of implementation, which is aimed at ensuring that the System
Works accurate and efficient as expect before, live operation, commences. It certifies that the
whole set of programs hang together system testing requires a test plan, That consist f several key
activities and step for run program, string, system and user acceptance testing. the implementation
newly design package is important in adapting a successful new system

Testing is important stage in software development system test is implementation should


be as confirmation that all is correct and opportunity to show the user that the system works as
they expected it accounts the largest percentage of technical effort in software development
process

Testing phase development phase that validates the code against the functional
specification. testing is a vital the achievement the system goals the objective testing is to discover
errors, to fulfill this objective a series of test step such as the unit test , integration , validation and
system test where planned and executed.

UNIT TESTING

Unit testing are called module testing. The following modules have been tested

• Link id - valid URL link.

• File Directory - valid location.


INTEGRATION TESTING

Following modules have been integrated for evaluating the efficiency of interface

• Check mode -. Changing dark mode

• User module - insert, download, clear, exit, back

The acceptance is the final stage of the user the various possibilities of the data are entered and
the result are tested.

VAILIDATION TESTING

Software validatilon is achived through a series of test that demonstrates the


conformity and requirement thus the proposed system under consideration has to be tested by
validation and found to be working satisfactorily

4.2 SYSTEM IMPLEMENTATION

Implementation is the final and important phase, the most critical stage in achieving a
successful new system and giving the user confidence. That the new system will work be effective
. The system can be implemented only after through testing is done and if it found to working
according to the specification
CONCLUSION
5. CONCLUSION

The project is an attempt to develop a system that can be used computerization of activities in the
company . Since these activities are tedious process lot of effort, more care has taken for the system
development the requirements a suitable database is created maximum effort were taken to avoid
duplication in data entry and data storage various report generated by this system

The major advantage of the system is fast accurate information retrieval minimization of clerical
work, easy and efficient data storage and report generation

A features that is required for the YOUTUBE VIDEO DOWNLOADER has been finished
successfully.
6. FUTURE ENHANCEMENTS

• Technology is constantly evolving and improved

• Cross platform compatibility has to be improved

• More securing issues have to be considered.

7.BIBLIOGRAPHY

7.1 REFERENCE BOOKS


• Python crash course – by Eric Matthes
• Fluent python – by Lynn Beighley & Michael Morrison
• Python Guide – by Vikram Vaswani
• Effective python – by Joel Murach & Ray Harris
• Python programming A Step-by-Step Guide to Creating Dynamic
Websites – by Robin Nixon

7.2 WEBSITE REFERENCE

7.2.1.1 https://www.tutorialspoint.com

7.2.1.2 https://www.w3schools.coM

7.2.1.3 https://www.youtube.com

7.2.1.4 www.visuastudio.com

You might also like