New video embedding
This commit is contained in:
		
							parent
							
								
									94e94cf7ca
								
							
						
					
					
						commit
						6673f7b615
					
				| @ -100,7 +100,7 @@ def embed_youtube(text): | |||||||
|             #    video_name = element.attrs["href"].split("?si=")[1].split("&")[0] |             #    video_name = element.attrs["href"].split("?si=")[1].split("&")[0] | ||||||
|             #if "t=" in element.attrs["href"]: |             #if "t=" in element.attrs["href"]: | ||||||
|             #    video_name += "&t=" + element.attrs["href"].split("&t=")[1].split("&")[0] |             #    video_name += "&t=" + element.attrs["href"].split("&t=")[1].split("&")[0] | ||||||
|             embed_template = f'<div><iframe width="560" style="display: block;" height="315" src="https://www.youtube.com/embed/{video_name}" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>' |             embed_template = f'<iframe width="560" style="display: block;" height="315" src="https://www.youtube.com/embed/{video_name}" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>' | ||||||
|             element.replace_with(BeautifulSoup(embed_template, "html.parser")) |             element.replace_with(BeautifulSoup(embed_template, "html.parser")) | ||||||
|     return str(soup) |     return str(soup) | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user