WEBVTT 00:00.790 --> 00:01.600 Welcome back. 00:01.600 --> 00:07.720 In this letter this tried to download three four videos and a one shot and also let us try to download 00:07.720 --> 00:09.160 videos from our file. 00:09.580 --> 00:15.720 So suppose I have the 60 file and I want to download all the videos that are available inside this file. 00:16.150 --> 00:19.030 So we'll be using file handler. 00:19.060 --> 00:24.160 Now think of a method that how we can download multiple videos in a single shot. 00:24.160 --> 00:29.230 The first thing we can do is we can create a list in which we can add video links. 00:29.260 --> 00:31.510 Then loop inside that list. 00:31.510 --> 00:34.750 This is the right method that currently I have in my mind. 00:35.010 --> 00:38.030 Let us now try and see what we can do. 00:38.190 --> 00:39.760 So let me create a list 00:44.000 --> 00:45.590 and let me add a few links. 00:45.780 --> 00:53.170 So I would be using my simple not the extreme for that and I will take rulings from the file it has 00:53.170 --> 00:58.300 high chances that these two links are the same links that I took in the previous example. 00:58.750 --> 01:02.700 So I just deleted both The Beatles which we downloaded in the previous lecture. 01:04.250 --> 01:05.920 Now I have two videos. 01:06.050 --> 01:12.200 So what I need to do is I need to run this command or both the videos so fast I'm going to take this 01:12.200 --> 01:18.830 link form the step that is stream select stream and save then be the second link select stream and then 01:18.830 --> 01:19.230 save. 01:19.550 --> 01:24.520 So that means I need to take this inside a loop or inside a condition. 01:24.770 --> 01:32.190 So what I can do is I can use a for so four will be my easiest approach to iterate all the elements 01:32.190 --> 01:34.160 that are available inside my list. 01:35.200 --> 01:39.080 So I will take the first element and I the boss here. 01:39.460 --> 01:42.420 It will do its stock loop back again. 01:42.470 --> 01:45.000 The second element do the task again. 01:45.010 --> 01:47.080 So head you can see everything looks fine. 01:47.080 --> 01:48.570 Let me run this one for a while. 01:51.320 --> 01:54.140 Remember I also need to add a print statement. 01:54.170 --> 01:56.300 Otherwise we are going to wait for a long time. 01:58.740 --> 01:59.380 That's done. 01:59.380 --> 02:01.020 Let me open my E drive. 02:02.110 --> 02:04.160 You see I have both the videos. 02:04.210 --> 02:04.520 OK. 02:04.630 --> 02:06.250 Let me add a pin statement here. 02:08.020 --> 02:13.760 Now the second approach we can do is instead of taking this list I can just statically take my sample 02:13.760 --> 02:15.080 out BSD. 02:15.190 --> 02:21.580 So what I can do is use my file handler that is open and then I need to pass my file name and then my 02:21.870 --> 02:22.570 ex is more 02:25.450 --> 02:29.730 so in my file name assembler to extend my access Modus read. 02:29.900 --> 02:36.370 So things looks fine a let me delete these two videos I have already downloaded them and let me run 02:36.370 --> 02:36.840 this one. 02:41.570 --> 02:42.130 OK. 02:42.140 --> 02:43.820 Oh I have a spelling mistake. 02:48.360 --> 02:49.560 Let me run this one again. 02:54.940 --> 03:01.300 Now we have our symbol or to the extent we are using on X's mode that is on what we are doing is we 03:01.300 --> 03:06.070 are taking everything inside our do list using our previous method and doing everything. 03:06.280 --> 03:12.430 But remember we have to take care about IBEX because quality can be different for each video. 03:12.430 --> 03:19.780 For example if I take the sample video this video can be available for 40 BP for 720 B but if I take 03:19.780 --> 03:23.870 a second video this video might not be available for 720 p. 03:23.950 --> 03:31.930 If I take two more videos maybe these both are not available for 360 B or 720 B so I tags will be different 03:32.740 --> 03:40.750 and if I open this one here you can see 22 is the eye tag for 720 B eighteen is the eye tag for 360 03:40.750 --> 03:41.170 B. 03:41.350 --> 03:46.740 So we have two bigger which resolution is available for each video. 03:47.190 --> 03:52.960 So has since I don't know about the I tags for both these videos I can actually print I tag for both 03:52.960 --> 03:56.800 of them all what I can do is I can use our first. 03:56.800 --> 03:59.660 That means I can add a method called first. 03:59.740 --> 04:01.030 What the hell about this. 04:01.060 --> 04:04.540 This would take highest resolution available for that video. 04:05.080 --> 04:06.230 Now let me run this one. 04:11.250 --> 04:12.950 So our first video is downloaded. 04:12.960 --> 04:19.950 Let me open my folder you can see I have a new video and I want to get my fourth video. 04:19.950 --> 04:23.580 So these two I downloaded earlier and these two are downloaded now. 04:23.970 --> 04:25.720 So this is working fine. 04:25.770 --> 04:30.920 I should add I try and accept blog because this line usually give errors. 04:30.990 --> 04:34.570 If I was trying to access a specific I. 04:35.490 --> 04:42.060 So if I remove this one and if I tried to run my court again I have a high chance to get an error because 04:42.060 --> 04:50.020 there are chances that both the videos are not available for a Dec. 22 hey you can see I got an error 04:50.040 --> 04:53.920 call 9 type and it is for line nobody. 04:54.120 --> 05:00.870 So if I go ahead you can see I got the error while downloading means I took this and I got to not object 05:00.870 --> 05:04.440 because there was no I Dec. 22 and I order an A. 05:04.830 --> 05:13.400 So I should try a block here and all these code inside that and then I should add an exit block call. 05:13.440 --> 05:14.490 This process will 05:19.770 --> 05:22.740 now this looks more proper code. 05:23.250 --> 05:27.280 If I run this one again I haven't dated. 05:27.470 --> 05:28.390 I dug. 05:28.520 --> 05:33.770 I'm just checking my brian except so bordered on where I'm feeling now. 05:33.810 --> 05:43.370 Let me add my first year pigment they need these two files on this one again in I have downloaded my 05:43.370 --> 05:53.320 first one this one is downloaded I didn't want my second one second one is all to download it Yeah that's 05:53.320 --> 05:59.980 fine so that's all we can work with our download option and that's how we can move good libraries try 05:59.980 --> 06:07.150 and catch begin also take our input method ahead and then ask user to give us the long link you can 06:07.150 --> 06:13.720 do a lot more thing and we can also try to print a statement here that our task is completed so we can 06:13.720 --> 06:17.770 do a lot more thing with pipeline and this was just a basic example. 06:17.890 --> 06:23.920 There are hundreds and thousands of packages and libraries I one so you can see we can automate a lot 06:23.920 --> 06:31.310 more task all you can do is just pass your links and you can just download them into one click. 06:31.400 --> 06:37.410 It was quite popular fuel back then there was slow internet connectivity and people used to run the 06:37.410 --> 06:43.370 script and they get free public Wi-Fi or when they have good internet connectivity so that's all these 06:43.370 --> 06:45.020 automation has done. 06:45.140 --> 06:46.880 I hope this letter was helpful. 06:46.940 --> 06:47.440 See you. 06:47.470 --> 06:48.090 The next one.