Node.js Express Facebook GraphQL API to Fetch Media & Video Downloader Links From URL in Browser
Jan 9, 2025
Buy the full source code of the application here:
https://procodestore.com/index.php/product/node-js-express-facebook-graphql-api-to-fetch-media-video-downloader-links-from-url-in-browser/
Buy Premium Scripts and Apps Here:
https://procodestore.com/
Show More Show Less View Video Transcript
0:01
uh hello guys welcome to this live
0:03
stream so in this live stream I will
0:05
basically talk about uh how we can
0:07
actually download uh the Facebook video
0:10
from URL and for this specific uh
0:13
application I have developed a simple
0:15
online tool on my website free mediat
0:17
tools.com and I will show you in this
0:19
video how I developed this so This is
0:22
actually Facebook video downloader you
0:24
will simply go to the description of
0:26
this live stream you will actually get a
0:29
payment link where you can actually I
0:31
purchase this product you will actually
0:32
get a live demo on that web page you
0:36
will you can directly go to this link
0:38
freem mediat tools.com media downloader
0:41
you can check out my free demo of this
0:43
tool before purchasing the source code
0:45
of this tool so here it allows you to
0:48
actually enter the
0:49
Facebook video URL so if you go to
0:52
Facebook you can pick any video if you
0:55
type any text out there and go to the
0:57
video section and let's suppose you want
1:00
to check out any
1:03
video I take this video for example and
1:06
you just need to copy this link and in
1:09
this tool you need to Simply paste this
1:12
link click on download video and it will
1:15
take some time this graph ql API it will
1:18
do the processing in the background and
1:20
then it will fetch the download link of
1:22
that particular video along with the
1:24
thumbnail you will see that guys the
1:25
thumbnail of the video is fetched and
1:27
now there is a download video option
1:29
click click on this button and now your
1:31
download will start so it will actually
1:34
download the video here you can see 61
1:37
megabytes are there so it is actually
1:39
using the graph ql API which is offered
1:41
by Facebook and we are actually making
1:43
HTTP request in the background and after
1:46
that it has fetched the video and you
1:48
can see the download links are there
1:50
simply need to click the download video
1:51
button so now it is just downloading
1:54
this video so depending upon your
1:56
internet speed it will actually download
1:58
this video onto your local machine so
2:01
that you can view this video offline
2:04
this is actually a Facebook video
2:05
downloader so it's a very handy
2:07
application out there so if you are
2:09
actually using Facebook for your daily
2:12
purpose you can actually copy the link
2:14
of the video and simply plug this tool
2:17
plug the link and click on download
2:18
video so it will actually fetch
2:20
whichever video you
2:24
want you can
2:30
suppose you want this video copy link
2:33
address again you will do the same
2:35
process paste the link click on download
2:37
video so now once again it is doing the
2:41
same job here it is actually processing
2:43
it it will fetching the download link
2:46
and uh you can basically see it is
2:48
actually this is the thumbnail of the
2:51
video matches the same you can see we
2:53
copy the
2:54
link and there is a download button
2:57
simply click download so once again your
2:59
download will start you will see
3:02
that so I can simply cancel this so so
3:06
now a video is downloading guys it is
3:09
around about 61 megabytes so 25
3:12
megabytes are already done so once it
3:14
downloads I will open the video and play
3:16
for you so typically this application
3:18
works
3:20
so the link is given you can directly
3:23
purchase this source code that I'm
3:25
giving you in nodejs Express this
3:27
complete application you can try this
3:29
application first of all on my website
3:31
free mediat tools.com before you
3:33
purchase the source code and uh I will
3:36
simply uh actually develop this
3:38
application in this live stream for you
3:41
guys so that you can clearly see it is
3:44
happening this is we are actually using
3:47
nodejs Express and for the specific
3:49
purpose we have developed a particular
3:51
module here coding sixa downloader this
3:53
is my custom module that I developed in
3:55
nodejs Express and it is actually using
3:58
graph Q in the background so I will
4:02
simply what I will do I will simply
4:04
write this code from
4:06
scratch so I will simply delete this
4:09
code also we are also using ejs template
4:12
engine so first of all what you need to
4:14
do right here inside locally you just
4:17
need to initialize and uh npm in a-y
4:22
this will actually create a package.json
4:24
file then you need to install Express
4:28
and ejs these are the two mod modules
4:30
that we need to install Express EGS so
4:32
once you actually purchase it you will
4:34
actually get a zip file from Google
4:36
Drive automatically this will be the zip
4:38
file you just need to extract that zip
4:40
file and then start this application by
4:42
invoking node index.js so this will
4:45
start your backend server and start your
4:47
application so now I just need to say
4:50
node
4:51
index.js this is nothing is there inside
4:54
this that's why it is not starting the
4:57
server so now it is is already done 53
5:01
megabytes are downloaded so once you can
5:04
see 30 seconds are left so once the
5:07
video downloads guys I just want to play
5:09
this video so that you can clearly see
5:11
the Facebook video downloader works so
5:14
it's a real application which downloads
5:16
video using graphql API and uh once it
5:21
downloads I can play this video
5:23
alongside the sound will also be there
5:25
in the video so you can clearly see full
5:28
HD video is
5:31
downloaded using this code so once it
5:34
complete you can see the code video is
5:36
completed
5:37
downloaded so you can see that guys now
5:39
the video is
5:41
full you can see the sound is also there
5:45
sound is also there in the video so you
5:47
can see the video is downloaded and this
5:49
is the actual tool you can try out this
5:51
tool guys from my website free Med
5:53
tools.com it is clearly live before you
5:55
purchase it so now let's get started so
5:58
now for building this this uh
6:01
application guys we can
6:04
now first of all let
6:09
me first of all start the express
6:12
backend server so what I will do is that
6:15
I will simply go to the index.js file
6:18
right here and first of all start our
6:21
basic Express server you will say let
6:25
Express and then we will instantiate a
6:27
new Express app and start this server on
6:31
Local Host 5000 so I will simply pick
6:33
the port number as Local Host 5,000 so
6:37
app is listening on Port 5000 and here
6:40
we will actually make uh set the view
6:42
engine which is ejs ab. set view engine
6:46
ejs so here we are essentially setting
6:48
the view engine to be
6:50
ejs and then we need to also include the
6:53
body passer middleware which is
6:55
essential while we are working with
6:57
forms so Express do
7:00
URL
7:03
encoded extended to
7:06
false so these two lines you need to
7:09
write guys before you are working with
7:10
forms right here that's why this two
7:13
lines are required and now we will
7:15
simply make a simple get request so
7:17
whenever someone goes to the homepage of
7:19
this application we need to Simply load
7:22
the template right here which will be
7:24
the index template so now we need to
7:27
actually make the views folder just make
7:29
the the views folder and inside this
7:31
make the index. EGS file EGS is
7:35
extension of EGS files so I can simply
7:39
give it a
7:41
title like
7:43
this so we also need to include
7:47
bootstrap for styling purpose so I will
7:50
simply include the CDN for bootstrap
7:52
after the title so you can see the
7:55
bootstrap CDN has been included now we
7:58
will actually be having a simple
8:01
heading in the center
8:04
position we are act using these
8:06
bootstrap
8:09
classes so if I uh start this server
8:12
right here if I type the command node
8:17
index.js or if I say nodeb
8:20
index.js it is saying that port number
8:23
5,000 is already in use so we can change
8:26
this port number to 3,000
8:30
so now you can see app is listening on
8:32
Port 500
8:34
3,000 if I go to this Local Host
8:39
3000 so now you can see that so now it
8:41
is uh heading is taking place it is
8:44
loading this file and now after this
8:46
what we need to do right here we need to
8:48
have a simple form and this form will
8:51
actually make a post request to this
8:53
route which is/ Fetch and the method
8:56
here will be post we will make a simple
8:59
post request and uh inside this we will
9:03
actually be having a input field where
9:06
the user will enter the URL of the
9:10
Facebook videos so we will give it a
9:11
label here to the user simply telling
9:14
the user what to write
9:16
here so we will give it a class of form
9:20
label this is actually a bootstrap class
9:23
you will say that
9:25
enter Facebook video URL
9:31
so after this we just need to say here
9:33
input type text and we need to give it a
9:36
class of form control and uh this will
9:39
be required and the placeholder will
9:42
will be enter
9:44
Facebook video
9:46
URL and we will also be giving a name
9:49
parameter to it so that we can Target in
9:52
node express code so this name parameter
9:55
is required because we will Target this
9:57
name parameter whenever we need to get
9:59
the value inside Express so this give it
10:02
a name attribute of video URL so after
10:05
you do this there will be this input
10:08
field added right here you will see that
10:09
this input field and after this we just
10:12
need to have a simple button to the user
10:15
so that they can actually download the
10:17
video so we will give it a bootstrap
10:20
class to it of BTN BTN
10:24
primary so there will be this button
10:26
added right here if you see and then
10:29
then we will simply be making this post
10:33
request you can change this to Facebook
10:36
video downloader like
10:38
this this is actual post request now we
10:41
need to make this post request by
10:43
writing this app.
10:48
poost so this will be a async
10:54
function so now we will actually be
10:58
getting the URL that user has written
11:00
the video URL by using request. body.
11:03
video URL so whatever name parameter
11:06
that you have given right here if you
11:07
see we have given this name parameter as
11:10
video URL so exactly we are writing this
11:13
name parameter and getting the URL so
11:16
after you get this URL the job becomes
11:19
very much easy I developed this uh
11:22
module guys for you guys only this
11:24
module allows to actually
11:27
download the Facebook
11:30
videoos so this module that I developed
11:32
coding sixa downloader so this module
11:35
will only be automatically be in present
11:38
in the zip file after you purchase it
11:40
and uh one such method is available in
11:44
this module which is and down this is
11:47
actual method which allows you to
11:49
download the Facebook video so we will
11:52
actually be using this method which uh
11:55
we will enclose this inside TR catch
11:57
block so if any any sort of error take
12:00
place we can simply console log the
12:02
error so in the tribe block we will
12:04
simply
12:05
be uh getting the data which is casing a
12:11
wait and we'll call this and down
12:13
function and pass the video URL so after
12:17
you get you'll actually be getting a
12:19
Json response console log
12:23
data so console log URL and uh we will
12:29
need to get fetch the data property of
12:31
it data.
12:40
data so we need to fetch the data
12:42
property of data zero so if you just see
12:46
uh if you refresh it and let's suppose
12:48
if you submit any URL of the YouTube
12:52
Facebook video if I paste this URL copy
12:55
link address paste it inside this
12:57
application click on download video
12:59
and if you see basically it is saying
13:01
video URL is not
13:06
defined uh let me see sorry this needs
13:10
to be URL not video
13:12
URL just makes make that
13:16
change so if you see uh
13:30
let me see if it is running
13:36
already okay okay sorry this my This is
13:40
My URL so yeah node mode index.js let me
13:44
start
13:46
this paste the URL click on download
13:49
video so you will basically see uh there
13:54
will be this uh Json response given to
13:56
us 720 HD quality thumbnail will be
14:00
returned to us this if you copy this
14:02
thumbnail and paste it in the browser
14:04
you will actually get the thumbnail of
14:06
the video of the Facebook video if I
14:09
simply contrl C on my keyboard so if I
14:13
try to open this so this will be the
14:16
actual thumbnail of the video that I
14:19
copy the and same in the second property
14:22
is the actual URL of the video you can
14:25
see that for every video this URL will
14:28
be unique and and if you directly paste
14:30
this URL in the browser the video will
14:31
get downloaded you will see that so now
14:34
the video downloaded has been started
14:36
and once it completes I can simply play
14:39
my video file in the video player
14:42
locally you can see that so we now need
14:45
to do this programmatically how after
14:48
you P purchase this source code you will
14:50
actually get this module which will
14:52
actually return this response as a Json
14:54
response of this Facebook video
14:56
downloader now what we need to do right
14:58
here we actually need to pass this
15:02
response which is coming right here and
15:04
pass it to the EGS template so what I
15:07
will do is right
15:09
here we will simply be passing this data
15:13
to the ejs template we will rerender the
15:16
template response render index and here
15:20
we will
15:21
pass first of all the
15:25
title we don't need to pass the title
15:27
right here we just need to say the
15:29
thumbnail of the video which will be
15:31
present inside URL sorry data do data0
15:36
do
15:38
thumbnail and the actual video so this
15:41
will be present inside data. data
15:45
zero. URL that's all so we also need to
15:49
initialize these two things thumbnail
15:51
video whenever
15:52
we right here you can say thumbnail to
15:55
be undefined and video to be un UND
15:59
defined so you do you do need to do this
16:01
if you don't do this you will get an
16:03
error because whenever we re uh first of
16:06
all render this page these two variables
16:08
will be undefined now we are rendering
16:10
this template so this two variables will
16:13
have these two things right here we will
16:15
pass these two things to the template
16:18
now we just need to add a if condition
16:20
in this template right here after the
16:22
form ends right here we will having a if
16:25
condition in the EGS template so
16:28
conditionally we are rendering the
16:29
things if thumbnail and the video
16:31
variable exist in that case only we need
16:34
to execute the below
16:37
code so these are the EGS template guys
16:40
which makes it very much easy to write
16:44
conditional
16:45
JavaScript so embedded JavaScript
16:48
template it's called EG so if it is
16:51
telling that if these two variable exist
16:53
then only execute this code which is
16:55
present so we will actually be rendering
16:58
out the down download links right
17:00
here so we will give it a class of text
17:08
Center image
17:13
source and uh we'll say
17:18
thumbnail here we'll be putting the
17:20
thumbnail of the video and this will be
17:24
give it a bootstrap class of image
17:27
thumbnail close it and then we will be
17:30
rendering out the video so for
17:34
video we will have a anchor tag and this
17:37
will be going to this URL which is
17:40
video so it will be opening in
17:44
a BTN BTN success we can give it a class
17:48
to it it will automatically download
17:50
we'll give it a download parameter to it
17:53
and the label will simply say download
17:57
video so that's all this is all that we
18:00
need to do if you refresh now your
18:02
application paste the URL click on
18:05
download video it will take some time
18:07
fetch the URL and now you can see that
18:09
it is showing the thumbnail of the video
18:11
and the button if you click the button
18:13
automatically your video will
18:15
automatically get downloaded and uh then
18:19
you can play your video on your video
18:21
player once it finishes you will see
18:24
that clearly with the sound as well so
18:28
you can take any video for example copy
18:30
link address take this video just need
18:33
to plug the URL click on download video
18:35
it will again fetch the video thumbnail
18:38
video URL all these things using graphql
18:41
API in the background that the module
18:43
that I you can see that
18:45
so you can see how awesome this
18:48
application is it makes it very much
18:50
easy for your task you don't need to go
18:52
to any third party website for
18:53
downloading Facebook videos it's a
18:55
complete project nodejs Express project
18:59
which makes it very much easy for you to
19:00
actually download Facebook videos and
19:02
using this module that I developed for
19:04
you so the link is given you can
19:06
directly purchase this project guys
19:08
which is you can first of all try this
19:10
application on my website freem mediat
19:12
tools.com by going to Facebook video
19:13
downloader try out this project if you
19:16
are interested then the link is given
19:17
you can directly purchase it in the
19:19
description of this video live stream
19:21
there will be the payment link available
19:23
you can purchase it after you purchase
19:25
it you will actually get this project
19:27
file from Google Drive after the payment
19:29
so thank you very much for watching this
19:31
live stream and I will be seeing you in
19:33
the next live stream
#Fun & Trivia
#Flash-Based Entertainment
#TV & Video
#Online Video
#Social Network Apps & Add-Ons
#Photo & Video Sharing
#Video Sharing
