Page 1 of 2

Re: Dailymotion/Metacafe support

Posted: Tue Feb 02, 2010 1:12 pm
by Eugene
cmk001 wrote:Thanks for such a nice programme, youtube is working now. Will appreciate if we can connect to Dailymotion and Metacafe Videos.
Version 0.72.2
Settings - Transcoder - Profiles - Add
Name: Podcasts (Metacafe,DailyMotion)
Execute mode: Transcoding
Language: PascalScript
Transcoding parameters:

Code: Select all

function HTTPDecode(const AStr: string): string;
var
  C, R: Char;  
  i: Integer;        
begin
  Result := ''; i := 1;
  while i <= Length(aStr) do begin
    C := aStr[i];
    R := #0;
    if C = '+' then  
      R := ' '      
    else if (C = '%') and (i < Length(aStr)) then begin
      Inc(i);     
      C := aStr[i];        
      if C = '%' then
        R := '%'
      else begin               
        R := Chr(StrToIntDef('$' + Copy(aStr, i, 2), 0));                 
        Inc(i)                 
      end      
    end else
      R := C;
    if R <> #0 then      
      Result := Result + R;        
    Inc(i)
  end
end;

function SearchLink(const aText, aRegEx: string; var aMatch: string): Boolean;
begin
  with TRegExpr.Create(aRegEx) do try
    Result := Search(aText);
    if Result then     
      aMatch := HttpDecode(Match)
  finally
    Free
  end    
end;

function SearchSize(const aText, aRegEx: string; var aWidth, aHeight: Integer): Boolean;
begin
  with TRegExpr.Create(aRegEx) do try
    Result := Search(aText);
    if Result then begin
      aWidth  := StrToIntDef(Match, 0);      
      aHeight := StrToIntDef(Match(2), 0);      
    end
  finally
    Free
  end    
end;  

function SelectDailyMotionLink(const aLink: string): string;
var
  sLink, sBestLink, sCurLink: string;  
  i, iWidth, iHeight, iBestFrameSize: Integer;
begin
  sLink := aLink; sBestLink := '';  
  iBestFrameSize := 0;
  while sLink <> '' do begin
    i := Pos('||', sLink);
    if i > 0 then begin
      sCurLink := Copy(sLink, 1, i - 1);      
      sLink := Copy(sLink, i + 2, Length(sLink))
    end else begin
      sCurLink := sLink;
      sLink := ''
    end;                     
    if SearchSize(sCurLink, 'FLV-(\d*)x(\d*)', iWidth, iHeight) or
       SearchSize(sCurLink, 'H264-(\d*)x(\d*)', iWidth, iHeight) then begin       
      if iBestFrameSize < iWidth * iHeight then begin      
        iBestFrameSize := iWidth * iHeight;
        sBestLink := sCurLink;      
      end      
    end;    
    if sBestLink = '' then    
      sBestLink := sCurLink
  end;  
  Result := sBestLink
end;

var
  sLink, sPage, sTranscoderParams: string;
begin
  sPage := WmsDownloadURL(InputFileName); sLink := '';
  if Pos('http://www.metacafe.com', LowerCase(InputFileName)) > 0 then begin  
    SearchLink(sPage, 'mediaURL=(.*?)&postRollContentURL', sLink)
  end else if Pos('http://www.dailymotion.com', LowerCase(InputFileName)) > 0 then begin  
    if SearchLink(sPage, 'addVariable\("video", "(.*?)"', sLink) then
      sLink := SelectDailyMotionLink(sLink)    
  end;                                
  if sLink <> '' then begin                           
    sTranscoderParams := WmsTranscodingProfileParams('Movies (primary)') + ' "<OUTPUT FILE>"';
    TranscodingResult := WmsTranscodingExecute('WMSMPEG', sTranscoderParams, True,
                                 WmsDownloadURLToPipe(sLink), OutputFileName)
  end else                 
    TranscodingResult := False    
end.
Choose profile transcoding "Podcasts (Metacafe, DailyMotion)" on the right-button mouse for selected podcasts.

Re: Dailymotion/Metacafe support

Posted: Thu Feb 04, 2010 9:30 am
by Eugene
cmk001 wrote:Thanks for fast reply, but not working on any link from Dailymotion or Metacafe. In monitor panel data line stays white and does not change colour to green.
For example ?

Re: Dailymotion/Metacafe support

Posted: Thu Feb 04, 2010 12:52 pm
by Eugene
cmk001 wrote:Please check this link http://www.dailymotion.com/video/x9xi72 ... irgini_fun

error log.
16:12:32:470 Sender: TWmsTranscodingItem.GetTranscodingCommandLine
?Podcasts (Metacafe,DailyMotion)
16:12:32:470 Sender: TWmsTranscodingItem.StartTranscoding
Enter: C:\wmmm\WmsTemp\Test_7243a503b7feb9b3e6b09cdc0743ca1e.mpg
16:12:32:471 Sender: TWmsTranscodingItem.StartTranscoding
Leave: C:\wmmm\WmsTemp\Test_7243a503b7feb9b3e6b09cdc0743ca1e.mpg, Result: 0
16:12:32:471 Sender: TWmsTranscodingItem.TranscodingFinish
TranscodingID: 655bcdbe566aa660e41d3968170e8f6e, TranscodingState: Stopped
16:13:19:759 Sender: TWmsTranscodingItem.GetTranscodingCommandLine
?Podcasts (Metacafe,DailyMotion)
16:13:19:759 Sender: TWmsTranscodingItem.StartTranscoding
Enter: C:\wmmm\WmsTemp\Test_09b597cf875cb3d646ad33bde0a83cba.mpg
16:13:19:759 Sender: TWmsTranscodingItem.TranscodingFinish
TranscodingID: 9033208d9dce6eb1c302096080f5dbd0, TranscodingState: Stopped
16:13:19:760 Sender: TWmsTranscodingItem.StartTranscoding
Leave: C:\wmmm\WmsTemp\Test_09b597cf875cb3d646ad33bde0a83cba.mpg, Result: 0
Test transcoding works? (video 11 sec)

Re: Dailymotion/Metacafe support

Posted: Fri Feb 05, 2010 12:00 pm
by Eugene
cmk001 wrote:After selecting Test Transcoding, a white data line in monitor panel shows but cmd window does not pop up to show progress of transcoding.
If you perform (green button) transcoding profile from editing (Settings-Transcoder-Profiles), then the problem exists?

Re: Dailymotion/Metacafe support

Posted: Fri Feb 05, 2010 8:43 pm
by Eugene
cmk001 wrote:I checked it, Message window says: Execution error: The URL does not use a recognized protocol
Before you begin, make the current testing resource in the list of films

Re: Dailymotion/Metacafe support

Posted: Sat Feb 06, 2010 3:08 pm
by Eugene
cmk001 wrote:Yes green check button in profiles gives Results: true but in Podcast-List movies , Yest Transcoding not working for example please try this link.
http://www.metacafe.com/watch/4126505/a ... eaturette/
After copying the transcoding profile name from the forum, the profile may have invalid name (two line), try to set the profile name manually.
http://www.metacafe.com/watch/4126505/a ... featurette - no any problems

Re: Dailymotion/Metacafe support

Posted: Tue Mar 02, 2010 4:02 pm
by Eugene
cmk001 wrote:Everything was working fine but suddenly Dailymotion is not working, Metacafe is OK. Test script/Test Transcoding also fails. Please advise.
http://www.dailymotion.com/rss/ - no problem

Re: Dailymotion/Metacafe support

Posted: Fri Mar 05, 2010 2:06 pm
by Eugene
cmk001 wrote:Is it possible to create a sub-folder under Podcasts and then assign a Transcoding profile to that sub-folder so that all podcasts in that sub-folder are handled by that Trancoding profile. Now I have to allocate same Trancoding Profile to each podcast seperately.
You can select multiple podcasts and set them to profile transcoding. Profile transcoding for a folder is added to future versions.

Re: Dailymotion/Metacafe support

Posted: Wed Mar 17, 2010 7:42 am
by Eugene
cmk001 wrote:A small problem. After upgrade to version 0.73 Podcast for Metacafe is transcoding well but Dailymotion is not working, even Test Trancoding is not working for Dailymotion, it is timed out and monitor window does not open.Please help.
http://www.dailymotion.com/rss/ - no problem

Re: Dailymotion/Metacafe support

Posted: Sat Apr 17, 2010 10:37 am
by Eugene
cmk001 wrote:Thanks for New Podcast changes in version 0.73.4. But my old Podcasts under my own Profile "Podcast-Daily Motion Metacafe" is no more working, please help.
Daily Motion - http://www.wildmediaserver.com/forum/vi ... 1635#p1635
Metacafe - http://www.wildmediaserver.com/forum/vi ... 1822#p1822
Drag & drop old podcast feeds to new folders. Change the properties of old feeds, set the inheritance properties of the parent folder.