Solved

YouTube API 3 removing video from playlist

Posted on 2014-09-22
5
399 Views
Last Modified: 2014-10-07
Hello, does anybody have an idea how to delete a video from a youtube playlist?  I have the video id and I believe I actually have to capture the playlistItemID on the return call but the syntax I'm not sure how to construct. The video adding which I have working is below.

                <cfset jsondet={

                    "snippet" = {
                       "playlistId" = "#youtube_playlist_id#",
                      "description" = "#getPlaylistData.playlist_description#",
                       "resourceId" = {
                          "kind"    = "youtube##video",
                          "videoId" = "#getPlaylistData.video_id#"
                       },
                       "position"   = 0
                    }

                }>

Open in new window

0
Comment
Question by:brihol44
  • 2
  • 2
5 Comments
 
LVL 62

Assisted Solution

by:gheist
gheist earned 334 total points
ID: 40339930
Code is in coldfusion. Are PHP and JavaScript areas related at all?
0
 
LVL 82

Assisted Solution

by:leakim971
leakim971 earned 166 total points
ID: 40340568
Here the doc :
https://developers.google.com/youtube/2.0/developers_guide_protocol_updating_and_deleting_videos#Deleting_a_video

So once you've the auth token and Id f the video send a DELETE to your video URL :

<cfhttp url="http://gdata.youtube.com/feeds/api/users/default/uploads/VIDEO_ID" method="delete" result="result">
        <cfhttpparam type="header" name="Authorization" value="GoogleLogin" auth=#variables.authtoken#">
        <cfhttpparam type="header" name="X-GData-Client" value="youtubecfc">
        <cfhttpparam type="header" name="X-GData-Key" value="key=#variables.devkey#">
</cfhttp>

Open in new window

0
 
LVL 62

Accepted Solution

by:
gheist earned 334 total points
ID: 40340914
0
 

Author Comment

by:brihol44
ID: 40342226
In order of the comments...

1. I looked through the code examples (js, php, others) and none refer to json structure I need to verify deleting playlist items.

2. Thx, I'm using 3.0 api not 2.0.

3. That page I have read three times but its not clear how to formulate the structure to send to make the video go away.

Thx for the initial help
0
 

Author Closing Comment

by:brihol44
ID: 40367660
Thx!
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
check mysql insert 12 27
angular 2 problem setting an object inside a subscribe section 15 19
Wordpress Only run code if on a certain page 11 23
if (is_singular not working 5 18
This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

838 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question