This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from submissions.models import MetaAd, MetaAdVid | |
from tools.meta_ads import MetaAds | |
meta_ads_no_vid = MetaAd.objects.filter(metaad_vids__isnull=True, direct_ad_full_md__isnull=False) | |
total_added = 0 | |
for meta_ad in meta_ads_no_vid: | |
ad_json = json.loads(meta_ad.direct_ad_full_md) | |
try: | |
content_url = ad_json['snapshot']['cards'][0]['video_sd_url'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip install m3u8_To_MP4 | |
# Code to download m3u8 links as mp4 files | |
import signal | |
import sys | |
import m3u8_To_MP4 | |
def handler(signum, frame): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip install m3u8_To_MP4 | |
# Code to download m3u8 links as mp4 files | |
import m3u8_To_MP4 | |
import os | |
import signal | |
def handler(signum, frame): | |
raise Exception('Function timed out') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip install m3u8_To_MP4 | |
# Code to download m3u8 links as mp4 files | |
import m3u8_To_MP4 | |
import os | |
def dl_m3u8(url, directory, filename): | |
# Note directory should be the filepath to save the file ex: '/home/username/bin' | |
# Directory can be a relative or absolute path | |
# Filename should end with an .mp4 ex: 'test.mp4' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First have to pip install "ffmpeg-python" | |
# Code to download m3u8 links as mp4 files | |
import ffmpeg | |
def dl_m3u8(dl_url, filepath): | |
try: | |
stream = ffmpeg.input(dl_url) | |
stream = ffmpeg.output(stream, f'{filepath}.mp4') | |
ffmpeg.run(stream) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OpenAll { | |
constructor() { | |
this.seenUrls = new Set(); | |
} | |
openWindows() { | |
const links = document.getElementsByTagName('a'); | |
const url = 'crm.kuhnlawgroup.com'; | |
for (let i = 0; i < links.length; i ++) { | |
if (!links[i].href.includes(url) && links[i].href.includes('.com')) { |