Skip to content

Commit

Permalink
Fixed Reuters download
Browse files Browse the repository at this point in the history
  • Loading branch information
ColumPaget committed Jan 27, 2017
1 parent c9dadae commit a443958
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 53 deletions.
2 changes: 1 addition & 1 deletion config.log
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ generated by GNU Autoconf 2.69. Invocation command line was
on rack1

config.status:729: creating Makefile
configure:4604: === configuring in libUseful-2.6 (/home/metacosm89/Movgrab/libUseful-2.6)
configure:4604: === configuring in libUseful-2.6 (/tmp/Movgrab/libUseful-2.6)
configure:4667: running /bin/sh ./configure --disable-option-checking '--prefix=/usr/local' '--enable-ssl' --cache-file=/dev/null --srcdir=.

## ---------------- ##
Expand Down
2 changes: 1 addition & 1 deletion config.status
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."

ac_pwd='/home/metacosm89/Movgrab'
ac_pwd='/tmp/Movgrab'
srcdir='.'
INSTALL='/bin/install -c'
test -n "$AWK" || AWK=awk
Expand Down
8 changes: 4 additions & 4 deletions libUseful-2.6/config.log
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ configure:3706: $? = 0
configure:3715: result: yes
configure:3731: checking for OpenSSL_add_all_algorithms
configure:3731: gcc -o conftest -g -O2 conftest.c -lcrypto -lssl -lc >&5
/tmp/ccmrexWp.o: In function `main':
/home/metacosm89/Movgrab/libUseful-2.6/conftest.c:59: undefined reference to `OpenSSL_add_all_algorithms'
/tmp/ccmnUf9b.o: In function `main':
/tmp/Movgrab/libUseful-2.6/conftest.c:59: undefined reference to `OpenSSL_add_all_algorithms'
collect2: error: ld returned 1 exit status
configure:3731: $? = 1
configure: failed program was:
Expand Down Expand Up @@ -360,8 +360,8 @@ configure:3731: $? = 0
configure:3731: result: yes
configure:3731: checking for EVP_rc5_32_12_16_cbc
configure:3731: gcc -o conftest -g -O2 conftest.c -lcrypto -lssl -lc >&5
/tmp/cc4C2m4g.o: In function `main':
/home/metacosm89/Movgrab/libUseful-2.6/conftest.c:62: undefined reference to `EVP_rc5_32_12_16_cbc'
/tmp/ccUeLvf6.o: In function `main':
/tmp/Movgrab/libUseful-2.6/conftest.c:62: undefined reference to `EVP_rc5_32_12_16_cbc'
collect2: error: ld returned 1 exit status
configure:3731: $? = 1
configure: failed program was:
Expand Down
2 changes: 1 addition & 1 deletion libUseful-2.6/config.status
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."

ac_pwd='/home/metacosm89/Movgrab/libUseful-2.6'
ac_pwd='/tmp/Movgrab/libUseful-2.6'
srcdir='.'
test -n "$AWK" || AWK=awk
# The default lists apply if the user does not specify any file.
Expand Down
75 changes: 30 additions & 45 deletions servicetypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,13 @@ case TYPE_IMDB:
RetVal=DownloadPage(Tempstr,TYPE_IMDB_STAGE2, Title,Flags);
break;


case TYPE_REUTERS:
Tempstr=CopyStr(Tempstr, GetVar(Vars,"ID"));
RetVal=DownloadPage(Tempstr,TYPE_REUTERS_STAGE2, Title,Flags);
break;


case TYPE_GAMESTAR:
Tempstr=SubstituteVarsInString(Tempstr,"http://gamestar.de/_misc/videos/portal/getVideoUrl.cfm?premium=0&videoId=$(ID)",Vars,0);
RetVal=DownloadItem(Tempstr, Title, Fmt, Flags);
Expand All @@ -623,7 +630,6 @@ case TYPE_GENERIC:
case TYPE_TED:
case TYPE_NATGEO:
case TYPE_UCTV:
case TYPE_REUTERS:
case TYPE_LIVELEAK:
case TYPE_EURONEWS:
case TYPE_SMH:
Expand All @@ -641,6 +647,7 @@ case TYPE_BREAK_STAGE2:
case TYPE_IGN_STAGE2:
case TYPE_IMDB_STAGE2:
case TYPE_STANFORD_STAGE2:
case TYPE_REUTERS_STAGE2:
case TYPE_FUNNYORDIE:
case TYPE_EBAUMSWORLD:
case TYPE_DAILYMOTION:
Expand All @@ -665,36 +672,6 @@ return(RetVal);
}


void BlipTVExtractFromLine(char *Line, ListNode *Vars)
{
char *ptr, *Type=NULL, *Width=NULL, *Height=NULL, *Tempstr=NULL;

GenericExtractFromLine(Line, "width","width=\"","\"",Vars,EXTRACT_DEQUOTE | EXTRACT_NOSPACES);
GenericExtractFromLine(Line, "height","height=\"","\"",Vars,EXTRACT_DEQUOTE | EXTRACT_NOSPACES);
GenericExtractFromLine(Line, "url","url=\"","\"",Vars,EXTRACT_DEQUOTE | EXTRACT_NOSPACES);

ptr=GetVar(Vars,"url");
if (StrLen(ptr))
{
ptr=strrchr(ptr,'.');
if (ptr) Type=CopyStr(Type,ptr+1);
}

ptr=GetVar(Vars,"width");
if (StrLen(ptr))
{
Width=CopyStr(Width,ptr);
Height=CopyStr(Height,GetVar(Vars,"height"));
Tempstr=MCopyStr(Tempstr,"item:",Type,":",Width,"x",Height,NULL);
SetVar(Vars,Tempstr,GetVar(Vars,"url"));
}

DestroyString(Type);
DestroyString(Width);
DestroyString(Height);
DestroyString(Tempstr);
}



void ExtractDailyMotion(const char *Line, const char *Start, const char *End, ListNode *Vars)
Expand Down Expand Up @@ -1037,32 +1014,37 @@ break;



#define REUTERS_FLV_ITEM_START "'flv':"
#define REUTERS_MP4_ITEM_START "'mpeg':"
#define REUTERS_TITLE "'headline':"

case TYPE_REUTERS:
ptr=strstr(Tempstr,REUTERS_FLV_ITEM_START);
#define REUTERS_ITEM_START "\"embedUrl\": \""
#define REUTERS_ITEM_END "\""
#define REUTERS_TITLE "\"headline\": \""

ptr=strstr(Tempstr,REUTERS_ITEM_START);
if (ptr)
{
GenericExtractFromLine(Tempstr, "item:flv",REUTERS_FLV_ITEM_START,",",Vars,EXTRACT_WITHIN_QUOTES | EXTRACT_NOSPACES);
GenericExtractFromLine(Tempstr, "item:flv",REUTERS_ITEM_START,REUTERS_ITEM_END,Vars,EXTRACT_NOSPACES);
}

ptr=strstr(Tempstr,REUTERS_MP4_ITEM_START);
ptr=strstr(Tempstr,REUTERS_TITLE);
if (ptr)
{
GenericExtractFromLine(Tempstr, "item:mp4",REUTERS_MP4_ITEM_START,",",Vars,EXTRACT_WITHIN_QUOTES | EXTRACT_NOSPACES);
GenericExtractFromLine(Tempstr, "Title", REUTERS_TITLE, REUTERS_ITEM_END, Vars, 0);
}
break;

case TYPE_REUTERS_STAGE2:
#define REUTERS_STAGE2_ITEM_START "'mid': '"
#define REUTERS_STAGE2_ITEM_END "'"

ptr=strstr(Tempstr,REUTERS_TITLE);
ptr=strstr(Tempstr,REUTERS_STAGE2_ITEM_START);
if (ptr)
{
GenericExtractFromLine(Tempstr, "Title",REUTERS_TITLE,",",Vars,EXTRACT_WITHIN_QUOTES | EXTRACT_NOSPACES);
GenericExtractFromLine(Tempstr, "item:flv",REUTERS_STAGE2_ITEM_START,REUTERS_STAGE2_ITEM_END,Vars,EXTRACT_NOSPACES);
}
break;



#define PHOTOBUCKET_START "\"fullsizeUrl\":\""
#define PHOTOBUCKET_END "\""

Expand Down Expand Up @@ -1558,10 +1540,13 @@ if (Flags & (FLAG_DEBUG2 | FLAG_DEBUG3)) fprintf(stderr,"\n------- END DOCUMENT
//if (StrValid(ptr)) M3UContainer(ptr, Vars);

ptr=GetVar(Vars,"Title");
if (! StrValid(ptr)) ptr=GetVar(Vars,"Title:meta");
if (! StrValid(ptr)) ptr=GetVar(Vars,"Title:html");
if (! StrValid(ptr)) ptr=Title;
SetVar(Vars,"Title",ptr);
if (! StrValid(ptr))
{
ptr=GetVar(Vars,"Title:meta");
if (! StrValid(ptr)) ptr=GetVar(Vars,"Title:html");
if (! StrValid(ptr)) ptr=Title;
SetVar(Vars,"Title",ptr);
}


if (MediaCount > 0) HandleMultipleMedia(Type,Server,Flags,Vars,MediaCount);
Expand Down
2 changes: 1 addition & 1 deletion servicetypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

typedef enum {TYPE_NONE, TYPE_GENERIC, TYPE_YOUTUBE, TYPE_YOUTUBE_SHORT, TYPE_METACAFE, TYPE_DAILYMOTION, TYPE_BREAK_COM, TYPE_EHOW, TYPE_VIMEO, TYPE_TED, TYPE_REUTERS, TYPE_LIVELEAK, TYPE_PHOTOBUCKET,TYPE_WASHINGTONPOST,TYPE_CBSNEWS,TYPE_FRANCE24,TYPE_EURONEWS,TYPE_METATUBE,TYPE_GUARDIAN,TYPE_REDORBIT, TYPE_UCTV, TYPE_ROYALSOCIETY, TYPE_DOTSUB,TYPE_ASTRONOMYCOM, TYPE_DISCOVERY, TYPE_BLOOMBERG,TYPE_NATGEO,TYPE_VIDEOBASH,TYPE_SMH,TYPE_FUNNYORDIE,TYPE_IGN,TYPE_EBAUMSWORLD,TYPE_GAMESTAR,TYPE_IMDB,TYPE_CHARLIEROSE,TYPE_STANFORD_OPENCLASS,
/*Following ones are not real types, but used by internal processes */
TYPE_BREAK_STAGE2, TYPE_VIMEO_STAGE2, TYPE_VIMEO_STAGE3, TYPE_CLIPSHACK_STAGE2, TYPE_CLIPSHACK_STAGE3, TYPE_VIDEOEMO_STAGE2,TYPE_MYVIDO1_STAGE2, TYPE_REFERENCE, TYPE_REDORBIT_STAGE2, TYPE_ASTRONOMYCOM_STAGE2,TYPE_CONTAINERFILE, TYPE_GOOGLE_URL, TYPE_YOUTUBE_PLAYLIST, TYPE_ROYALSOCIETY_STAGE2, TYPE_STANFORD_STAGE2, TYPE_IGN_STAGE2, TYPE_IMDB_STAGE2, TYPE_M3U8_STREAM, TYPE_CONTAINERFILE_M3U8, TYPE_CONTAINERFILE_PLS, TYPE_CONTAINERFILE_ASX} TDT;
TYPE_BREAK_STAGE2, TYPE_VIMEO_STAGE2, TYPE_VIMEO_STAGE3, TYPE_CLIPSHACK_STAGE2, TYPE_CLIPSHACK_STAGE3, TYPE_VIDEOEMO_STAGE2,TYPE_MYVIDO1_STAGE2, TYPE_REFERENCE, TYPE_REDORBIT_STAGE2, TYPE_ASTRONOMYCOM_STAGE2,TYPE_CONTAINERFILE, TYPE_GOOGLE_URL, TYPE_YOUTUBE_PLAYLIST, TYPE_ROYALSOCIETY_STAGE2, TYPE_REUTERS_STAGE2, TYPE_STANFORD_STAGE2, TYPE_IGN_STAGE2, TYPE_IMDB_STAGE2, TYPE_M3U8_STREAM, TYPE_CONTAINERFILE_M3U8, TYPE_CONTAINERFILE_PLS, TYPE_CONTAINERFILE_ASX} TDT;

extern char *DownloadTypes[], *DownloadNames[], *TestLinks[];

Expand Down

0 comments on commit a443958

Please sign in to comment.