
Recherche avancée
Autres articles (92)
-
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configuration spécifique pour PHP5
4 février 2011, parPHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
Modules spécifiques
Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)
Sur d’autres sites (5680)
-
Python code to download hls stream to mp4
2 décembre 2024, par Maad A.GalilI wrote the following code to download a video from a website. Chrome extensions can detect the video and download it. However, my code gets the following errors. Any help ?


from bs4 import BeautifulSoup
import requests
from subprocess import check_output

video_url = 'https://www.dimakids.com/ab6al-aldigetal-s3-1415387355-21011.html#sets'
headers = {'User-Agent': 'Mozilla/5.0'}

url = requests.get(video_url, headers=headers)
page = url.content
soup = BeautifulSoup(page, "html.parser")

result = str(soup.find_all('video')[0])
result = result.split('src="')[1].split('" type=')[0] 
print(result)

# seg = requests.get(result)
# """
# Error: requests.exceptions.SSLError: HTTPSConnectionPool(host='stream.foupix.com', port=443): Max retries exceeded with url: /animeios/1415387355/ab6al_aldigetal_s3_01.mp4/index.m3u8?tkn=jja4Czj-AzbJx1JmvDvQeA&tms=1733079050 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))
# """
# print(seg)


print(check_output(f'ffmpeg -i "{result}" -codec copy file.mp4', shell=True))
"""
Error: https://stream.foupix.com/animeios/1415387355/ab6al_aldigetal_s3_01.mp4/index.m3u8?tkn=SWf7n3qH8MwFLlq18wngIQ&tms=1733079103: Server returned 403 Forbidden (access denied)
"""



The link works as any hls downloader can capture the video and download it as seen here (of course token and timestamp values change everytime it captures the video) :


Page URL https://www.dimakids.com/ab6al-aldigetal-s3-1415387355-21011.html#sets


Thumbnail https://www.dimakids.com/images/anime/cat_1415387355.jpg




video component https://stream.foupix.com/animeios/1415387355/ab6al_aldigetal_s3_01.mp4/index.m3u8?tkn=6nyEskSbHBI713sG0uhZJQ&tms=1733171604


-
avformat/matroskaenc : Allow to use custom reformatting functions
15 janvier 2022, par Andreas Rheinhardtavformat/matroskaenc : Allow to use custom reformatting functions
Matroska uses variable-length elements and in order not to waste
bytes on length fields, the length of the data to write needs to
be known before writing the length field. Annex B H.264/5 and
WavPack need to be reformatted to know this length and this
currently involves writing the data into temporary buffers ;
AV1 sometimes suffers from this as well.This commit aims to solve this by adding a callback that is called
twice per packet : Once to get the size and once to actually write
the data. In case of WavPack and AV1 (where parsing is cheap due
to length fields) both calls will just parse the data with only
the second function writing anything. For H.264/5, the position
of the NALUs will need to be stored to be written lateron.Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-
How to calculate the "Range" header for mp4 file to play/download a part of it ? [youtube-dl]
5 décembre 2016, par supersanI’m using youtube-dl to download videos from YouTube. Unfortunately, sometimes I just need to download a part of the video like 10 seconds of a 3 hour video and here is how I see I can do it.
Step 1 : Get the URL of the mp4 file from youtube-dl.
youtube-dl -g -f "[ext=mp4]" https://www.youtube.com/watch?v=qOZ1u9VpoMk
This returns
$url
: the full URL of mp4 file on server.Step 2 : Download part of the video using curl
curl -r $startBytes-$endBytes $url
But how to calculate
$startBytes
and$endBytes
. What is the formula for that ?P.S I was thinking could be something as simple but this isn’t it..
$startBytes
= (total_size_of_video / total_length_of_video_secs) * start_secondsP.P.S. When I play the mp4 video in Chrome and use the scrub bar to jump around in the video, Chrome too send the Range header to the same URL (as I can see in fiddler)