                              DMCrack v0.16b
                              ==============
              DMCRACK.TXT - Copyright (c) 2013, Fred C. Macall
   

History and Overview

DMCrack is a DOS program for extracting "video" URL(s) from fresh copies
of DailyMotion embed files.  That is, copies of files with URLs like:
http://www.dailymotion.com/embed/video/xvn4m3

DMCrack produces its result(s) in a small .HTM document or file.
This document exposes anchor(s) or link(s) to the DailyMotion video URL(s)
that DMCrack has extracted from a given DailyMotion embed file copy.
This results document may be used by a Web browser, without scripts nor
"Flash" support, for downloading the DailyMotion video(s) its anchor(s)
identify.

DMCrack is descended from YTCrack v0.24b.  And, DMCrack is to DailyMotion
much as YTCrack is to YouTube and video.google.  For the most part, the
differences between DMCrack and YTCrack stem from the differences between
DailyMotion and YouTube.  First, there is the difference in where the video
or videoplayback URLs sought reside.  YouTube and video.google
videoplayback URLs (still) are found in their Web pages (html documents).
DailyMotion's more prominent Web pages no longer seem to carry useful video
URLs.  For a while, these seemed to be found, somewhat concealed, in
DailyMotion's .SWF files (Shock Wave Flash scripts).  But, beginning on or
about 1 July 2013, they seemed to be gone from those, as well.  With help
from the dailymotion.py file included in the youtube-dl package, we have
learned that DailyMotion's embed files (still) carry DailyMotion's video
URLs.  The youtube-dl package is available from:
http://rg3.github.io/youtube-dl/

(This paragraph is obsolete.  We are leaving it here only to document the
method that DMCrack originally was designed to use:
As is customary, DailyMotion's .SWF files are compressed.  They need to be
expanded in order to expose the video URL(s) they carry.  Rather than do
this expansion itself, DMCrack relies on the use of an .SWF file
uncompression tool or utility such as CWS2FWS.  To facilitate this
arrangement, the DMCrack package includes DMCRACKX.BAT .  It is a small
"wrapper", which combines a run of CWS2FWS with a run of DMCrack.)

Another difference lies in the VideoIDCode, xvn4m3, or video name's
structure.  YouTube uses an eleven characters long VideoIDCode containing
mixed case letters, digits, and a few special characters.
For the most part, DailyMotion's xvn4m3 starts with x, is six characters
long, and only contains lower case letters and digits.  We have seen a few
that only are five characters long.  While the newest ones seem to be seven
characters long.  Once one recognizes these differences, DailyMotion's
xvn4m3(s) will be found easier to use, than YouTube's VideoIDCode(s).
However, one needs to be more careful in using DailyMotion's xvn4m3(s).
Because, they lack the redundant content that enables YouTube's servers
to detect typos.  In other words:  If you misspell a DailyMotion xvn4m3,
you are fairly likely to arrive upon the xvn4m3 for another DailyMotion
video!

Finally, there are differences in how the offered videos' resolution and
other characteristics are described.  YouTube and video.google
videoplayback URLs include only an itag=nnn field, which needs to be
decoded for presentation.  (In the last year or two human readable
quality= . . . and type= . . . fields have been added in close proximity
to, but still not part of, YouTube's videoplayback URLs.  Even in close
proximity to their videoplayback URLs, these new fields get entangled in
YouTube's signature obfuscation machinations!)  In contrast, DailyMotion
video URLs carry a concise human readable description that can be located
and presented without parsing nor decoding complications.

From DMCrack's beginning, DailyMotion's video URLs have been seen to end
with the sequence:
?auth=<hexdigits><divider><hexdigits>
Where <divider> consists of one of the minus, period, and, perhaps,
underbar characters.  DMCrack has parsed that sequence in order to
determine each video URL's exact end point.  On or about 4 October 2013,
DailyMotion expanded that auth= . . . field's value to include multiple
divider characters and lower case letters, other than hex digit characters.
As a result, DMCrack's existing auth= . . . field parsing failed by
terminating early.  This failure kept all then existing versions of DMCrack
from extracting any acceptable video URL(s).

Beginning with version 0.16b, DMCrack parses the ending sequence:
?auth=<hexdigitslowercaselettersordividers>
in order to determine each video URL's exact end point.  Successfully,
again.

The DailyMotion videos we've seen, so far, are all .MP4 types that contain
an H.264 video stream and an AAC audio stream.  Given a suitable video
adapter and fast enough processor, these may be viewed/heard with the
latest DOS MPLAYER make.  So, your whole video receiving and
viewing/listening process can be accomplished in DOS without scripts
enabled and without Flash support.  And, it yields downloaded video file(s)
that don't have to be discovered in and retrieved from a cache directory.

The DailyMotion embed files we've studied, so far, all carry one copy of
each of one to five unique video URLs.  Out of a habit developed in
YTCrack, DMCrack still checks these for duplicates to be weeded out.

DMCrack is intended to run on an 8086/8088 based, and all later, IBM PC
compatible PC.  DMCrack has a modest need for DOS memory, and only requires
DOS v3.x, or later.


How It Works

DMCrack starts off by checking for a pair of command line parameters that
do not match each other.  Finding anything else, it displays its Usage
message and terminates.  For the record, this message reads:

Usage:  DMCRACK <input file name> <output file name>

Where:  <input file name> specifies a fresh copy of an
        http://www.dailymotion.com/embed/video/<vidn> file.
        And, <output file name> specifies an HTML page to be produced.
        The two file names must differ.

DMCrack then opens both of its given files.  And, starts reading through
its input file.  As it reads, DMCrack replaces any null(s) read with
at sign characters.  This enables DMCrack to employ C strstr( ) and
strchr( ) calls for examining the whole input buffer, without getting
stopped by null(s) in .SWF file data.  They are stopped by a null placed
at the end of the input buffer.

As it reads, DMCrack looks for URLs of the form:

http<wildtext1>/cdn<wildtext2>/video<wildtext3><terminator>

Where:  <wildtext1> is any text that doesn't include space character(s),
        /cdn, /video, nor http.
        <wildtext2> is any text that doesn't include /video nor http.
        <wildtext3> is any text that doesn't include http.
        <terminator> is http or the end-of-file indication.
 
DMCrack then looks through each video URL it has found, for %hh sequences
and back slash characters.  (There may not be any %hh sequence(s).)
All three character %hh sequences get replaced with the single character
that the hex digits hh represent.  And, this process gets repeated when %25
gets replaced by % .  However, any % not followed by hh gets left as-is.
Next, back slash characters are sought.  All six character \uhhhh sequences
get replaced with the single character that the least significant eight
bits of hhhh represents.  (There may not be any \uhhhh sequence(s).)
All remaining back slash character(s) get removed.

Finally, each URL's "tail" used to get trimmed at the end of its
?auth=<hexdigits><dividercharacter><hexdigits> field, if any.
Where the <dividercharacter> may be period, minus, or underbar.

Beginning with DMCrack version 0.16b, this trimming is done by looking
for the end of:
?auth=<hexdigitslowercaselettersordividercharacters>

DMCrack parses this field as follows:  First, it looks for ?auth= .
Then, it looks for the first character following, which isn't a hex digit,
lowercase letter, or divider character.  The character thus found marks the
spot for trimming the URL.

With its batch of video URL(s) unencoded and clarified as explained above,
DMCrack looks through them all and eliminates any duplicate(s) present.
It doesn't appear likely that there will be any duplicate(s) present.
But, it doesn't hurt to check.

DMCrack then prepares a small html document exposing anchors or links
containing the distinct video URL(s) that it has found.  For all URL(s)
that contain a /cdn/<anythingbut/video/>/video/ sequence, the
<anythingbut/video/>
part of that gets used for the anchor's visible text.

In case a sequence starting with /cdn/ and ending with /video/ isn't found
in a URL, the visible text:
video URL number nn
will be used.  Where nn indicates the number of this video URL's first
appearance in the given document's sequence of video URLs.


Installation and Operational Considerations

PKUNZIP DMCRAC16.ZIP
into an empty directory.  Copy the resulting files to where you want them.
You may as well put DMCRACK.EXE in a directory on your Path.
There is nothing to configure.

Here is the process for obtaining a DailyMotion video with DMCrack:

We're not sure what all goes into DailyMotion's auth= . . . fields, for a
video.  But, they may require that you start by getting a fresh copy of the
DailyMotion embed file describing the video you want to receive.
The general form of the URLs for these is given at the very beginning of
this document.

Here is a specific example:  Get
http://www.dailymotion.com/embed/video/x10uy18
and save it as, say:  X10UY18.EMB .

Then, command:
DMCRACK X10UY18.EMB X10UY18.HTM

Finally, open X10UY18.HTM in your Web browser and request one of the exposed
video URL(s).

If you want to get (back) to the main Web page describing a DailyMotion
video, look for:
<link rel="canonical" href= . . .
at the end of the embed file's html <head> section.


Copyright Notices

DMCRACK.EXE v0.16b and the libraries, materials, and tools used to make it
contain the following Copyright notices:

Borland C++ - Copyright 1991 Borland Intl.

LZEXE.EXE  Version 0.91   (c) 1989 Fabrice BELLARD


Disclaimer

This software is published in the hope that it will be useful, but without
any warranty;  without even the implied warranty of merchantability or
fitness for a particular purpose.


Fred C. Macall  K8GIV
1019 Pennfield Road
Cleveland Heights, Ohio, 44121, U.S.A.
(216) 382-3415
For e-mail contact, run DMCrack .
http://users.ohiohills.com/fmacall/
14 October 2013
