Пробуем по другому
This commit is contained in:
		
							parent
							
								
									7bc0336b7a
								
							
						
					
					
						commit
						766f7d4f9d
					
				|  | @ -28,12 +28,15 @@ public function index(Request $request) | ||||||
|                 return response(json_encode($response)); |                 return response(json_encode($response)); | ||||||
|             } else { |             } else { | ||||||
|                 $videotitle = $video->getFile()->getFilename(); // Will return Phonebloks
 |                 $videotitle = $video->getFile()->getFilename(); // Will return Phonebloks
 | ||||||
| 		$videotitle = str_replace('webp', 'mp4', $videotitle); |                 $videotitle = str_replace('webp', 'mp4', $videotitle); | ||||||
| 		//$file_path = public_path('/'.'downloads/'.$videotitle);
 |                 //$file_path = public_path('/'.'downloads/'.$videotitle);
 | ||||||
|         	//return response()->download($file_path);
 |         	    //return response()->download($file_path);
 | ||||||
|                 // $video->getFile(); // \SplFileInfo instance of downloaded file
 |                 // $video->getFile(); // \SplFileInfo instance of downloaded file
 | ||||||
|                 //$file_path = public_path('/downloads/'.$videotitle);
 |                 //$file_path = public_path('/downloads/'.$videotitle);
 | ||||||
|                 return redirect()->route('download', [$videotitle]); |                 $response = new \stdClass(); | ||||||
|  |                 $response->link = $videotitle; | ||||||
|  |                 return response(json_encode($response)); | ||||||
|  |                 //return redirect()->route('download', [$videotitle]);
 | ||||||
|                 //return response()->download($file_path);
 |                 //return response()->download($file_path);
 | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -3,9 +3,10 @@ | ||||||
|         <v-card-text class="d-flex justify-center align-center"> |         <v-card-text class="d-flex justify-center align-center"> | ||||||
|             <v-card class="align-center justify-center h-auto w-33"> |             <v-card class="align-center justify-center h-auto w-33"> | ||||||
|                 <v-card-title>Вставьте ссылку:</v-card-title> |                 <v-card-title>Вставьте ссылку:</v-card-title> | ||||||
|                 <v-card-text> |                 <v-card-text class="justify-center"> | ||||||
|                     <v-text-field v-model="url" label="Ссылка"/> |                     <v-text-field v-model="url" label="Ссылка"/> | ||||||
|                     <v-btn @click="startDownload">Скачать</v-btn> |                     <v-btn @click="startDownload">Найти</v-btn> | ||||||
|  |                     <v-btn>Скачать</v-btn> | ||||||
|                 </v-card-text> |                 </v-card-text> | ||||||
|             </v-card> |             </v-card> | ||||||
|         </v-card-text> |         </v-card-text> | ||||||
|  | @ -26,8 +27,8 @@ export default { | ||||||
|         startDownload(){ |         startDownload(){ | ||||||
|             this.fetching = true; |             this.fetching = true; | ||||||
|             axios.get(`/download_api?videourl=${this.url}`).then((responce)=>{ |             axios.get(`/download_api?videourl=${this.url}`).then((responce)=>{ | ||||||
| 		this.fetching = false; |                 this.fetching = false; | ||||||
| 		console.log(responce); |                 console.log(responce); | ||||||
|             }) |             }) | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -3,7 +3,7 @@ | ||||||
|     <head> |     <head> | ||||||
|         <meta charset="utf-8"> |         <meta charset="utf-8"> | ||||||
|         <meta name="viewport" content="width=device-width, initial-scale=1"> |         <meta name="viewport" content="width=device-width, initial-scale=1"> | ||||||
|         <title>Boilerplate</title> |         <title>Youtube Download</title> | ||||||
|         @vite('resources/app.js') |         @vite('resources/app.js') | ||||||
|         @vite('resources/css/app.css') |         @vite('resources/css/app.css') | ||||||
|     </head> |     </head> | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue