Open VikasHK127001 opened 3 months ago
pydrive
for authentication and accessing Google Drive.Initialize the Facebook Ads API using provided credentials (app_id
, app_secret
, access_token
) and specify the API version (v19.0
).
download_videos_from_drive(folder_id)
Authenticates to Google Drive using GoogleAuth()
and downloads all MP4 videos from the specified folder (folder_id
). Returns a list of downloaded video filenames.
create_campaign(name)
Creates a new Facebook ad campaign with the given name
, specifying parameters such as objective
and special_ad_categories
.
create_ad_sets(campaign_id, folder_name, videos)
Creates multiple ad sets for a campaign (campaign_id
), based on the number of videos (videos
) available in a Google Drive folder (folder_name
). Sets parameters like billing_event
, optimization_goal
, bid_amount
, daily_budget
, targeting
, start_time
, and platform preferences.
create_ad(ad_set_id, video_file)
Creates an individual ad within an ad set (ad_set_id
) using a specified video file (video_file
). Defines an ad creative (ad_creative
) with parameters like page_id
, link_data
(URL, message, headline, description), and call-to-action. Uploads the video file and sets ad parameters such as name
, thumbnail_url
, and status
.
main()
Main function that orchestrates the entire process:
drive_links
, a dictionary mapping campaign names to Google Drive folder IDs.drive_links
, downloads videos using download_videos_from_drive()
, creates a campaign with create_campaign()
, creates ad sets with create_ad_sets()
, and then iterates through downloaded videos to create individual ads using create_ad()
.The script executes the main()
function if it is run directly (__name__ == "__main__"
).
DONT STORE THE CREDNTIALS IN TO YOUR GITHUB REPOSITORY. https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions
app_id
, app_secret
, access_token
, ad_account_id
, page_id
) with actual credentials and IDs.facebook_business
, pydrive
) using pip install facebook_business pydrive
.drive_links
) and other parameters are correctly configured for your specific campaigns.If you have any specific questions about any part of the script or need further assistance, feel free to ask!
So, your script 'Script-ADS' is not working correctly, or do you want a script from scratch?
No, that is a description on how to use the Script?
You need the facebook credentials for developing this
So first of all register for api access
Hello, I saw your proposal on Upwork. What exactly do you want?