YouTube Video-Thumbnail Resolutions

Following: list of link resources and resolutions.

  • resolution might depend on video-itself, on some point I’ve got for mqdefault a 266x150
  • if your source does not origin from HTTPS you might want to use http prefix.
  • optionally replace the i in the host i.ytimg.com to i1, i2, i3 or i4.
  • the main difference between the webp and jpg sources is that webp‘s outline margins in 4:3 image on natural-16:9-thumbnail are white.

LinkResolutionRatio
https://i.ytimg.com/vi/{YouTube-Video-ID}/default.jpg120×904:3
https://i.ytimg.com/vi/{YouTube-Video-ID}/0.jpg480×3604:3
https://i.ytimg.com/vi/{YouTube-Video-ID}/hqdefault.jpg480×3604:3
https://i.ytimg.com/vi/{YouTube-Video-ID}/maxresdefault.jpg1280×72016:9
https://i.ytimg.com/vi/{YouTube-Video-ID}/mqdefault.jpg320×18016:9
https://i.ytimg.com/vi/{YouTube-Video-ID}/sddefault.jpg640×4804:3
https://i.ytimg.com/vi_webp/{YouTube-Video-ID}/default.webp120×904:3
https://i.ytimg.com/vi_webp/{YouTube-Video-ID}/0.webp480×3604:3
https://i.ytimg.com/vi_webp/{YouTube-Video-ID}/hqdefault.webp480×3604:3
https://i.ytimg.com/vi_webp/{YouTube-Video-ID}/maxresdefault.webp1280×72016:9
https://i.ytimg.com/vi_webp/{YouTube-Video-ID}/mqdefault.webp320×18016:9
https://i.ytimg.com/vi_webp/{YouTube-Video-ID}/sddefault.webp640×4804:3

Bring Adobe Flash Back To Chromium (Solved)

ahhh… I had to figure out this one for myself from the source-code of Chromium (Chrome) project at:
http://src.chromium.org/svn/trunk/src/chrome/common/chrome_switches.cc and http://src.chromium.org/svn/trunk/src/base/base_switches.cc… :(

Apparently-
New Chromium versions does not have Flash anymore!
– Chrome (regular and Canary) still does.

also, and there are no-people figuring out the solution yet, (as far as Googling around shows..)
so this post should be the first one to explain how to re-enable Adobe Flash on New Chromium installations.

it should be compatible with Windows, Mac and Linux installations.

Chromium not just disable Flash, but it does not ship with the ‘pepflashplayer.dll’,
in fact- the folder, named PepperFlash, which is the code-name for the embedded plugin for Flash, is empty:

icompile.eladkarako.com_bring_flash_back_to_chromium_solved__empty_pepperflash_folder

you can look for pepflashplayer.dll in the Google-Chrome-Canary or regular versions and copy it to the folder but it won’t do anything (check using chrome://flash/)
icompile.eladkarako.com_bring_flash_back_to_chromium_solved__no_flash

for Chromium’s plugin-engine to identify the plugin, you’ll need to use some command-line switches,
but first let us play smart, assuming you’ll be updating Chromium somewhere in the future, the application folder will get overwritten so we’re not going to play with files and folders,
lets use the official Adobe plugin!

– download the latest Flash version from the http://labs.adobe.com/downloads/flashplayer.html
I currently developing some video-players with Flash fallback, so I’m using the “+Debugger” version.. but feel free to download the regular one.

its best for you to first download the uninstaller: http://labsdownload.adobe.com/pub/labs/flashruntimes/flashplayer/flashplayer17_uninstall_win.exe
run it to clean the old versions (make all of the browsers are closed, even their background processes, just use task-manager and kill chrome.exe firefox.exe and iexplore.exe if any..)

then the IE version:
http://labsdownload.adobe.com/pub/labs/flashruntimes/flashplayer/flashplayer17_debug_win_ax.exe, and install it.

then the “other” browsers version:
http://labsdownload.adobe.com/pub/labs/flashruntimes/flashplayer/flashplayer17_debug_win_pi.exe, and install it.

and the “other other” browsers version:
http://labsdownload.adobe.com/pub/labs/flashruntimes/flashplayer/flashplayer17_debug_win_ppapi.exe, and install it too.

icompile.eladkarako.com_bring_flash_back_to_chromium_solved__what_to_download

in a second, we will be adding some command-line argument to Chromium, but first we need to find out where are the pepflashplayer{architecture}_version_ver._ver._ver.dll is located, and what is their named:

there are two folders:

C:\Windows\System32\Macromed\Flash\

and

C:\Windows\SysWOW64\Macromed\Flash\

one is holding the x32 version of Flash, and the other is holding the x64 version.
you can visit chrome://chrome/
to see what version you are using, I’m using the x64 version of Chromium for windows..
icompile.eladkarako.com_bring_flash_back_to_chromium_solved__what_is_your_browser_architecture

normally the C:\Windows\System32\Macromed\Flash holds the x32 version and the C:\Windows\SysWOW64\Macromed\Flash\ has the x64 version.

right! so the x64 version it is,

WAIT!!!
Adobe guys had a bug in the installation script, and the DLL FILES location are upside-down:
icompile.eladkarako.com_bring_flash_back_to_chromium_solved__official_adobe_versions_of_pepperflash

ok, so now we’ll be using two switches, one to disable the embedded-plugin (even that it is “not there”) and the other one to force load a flash-plugin from C:\Windows\System32\Macromed\Flash folder.

here is an example for the command line to load Chromium, with Flash support, (again):

C:\Users\Elad\AppData\Local\Chromium\Application\chrome.exe --disable-bundled-ppapi-flash --ppapi-flash-path="C:\Windows\System32\Macromed\Flash\pepflashplayer64_17_0_0_93.dll"

you may put it in a cmd file, or just create a shortcut for chrome.exe and after “OK”‘ing it, just re-edit it adding a --disable-bundled-ppapi-flash --ppapi-flash-path="C:\Windows\System32\Macromed\Flash\pepflashplayer64_17_0_0_93.dll" at the end.

sometimes sending arguments is hard in windows, most of the time there is a lot of inverted commas confusion and mix-ups.

you can download the exe and the ini file from my github page:
https://github.com/eladkarako/iniRun/tree/master/real_world_example

after you’ll run the exe a Chromium process will be created with the arguments passed directly to the Windows-API (so- FAST!) re-open the chrome://flash/ page, and see something like that:

icompile.eladkarako.com_bring_flash_back_to_chromium_solved__flash_loaded_x64bit

enjoy!

4Chan API – Cross-Domain Image Fetcher – Usage + Examples

The following example on my GitHub project-page, shows, hopefully a clear way, on how to do some Ajax requests on client side, fetching each of the threads in a board, in which all the posts, and all the image links within, 4chan_api

after fetching the information, a Handlebars-Mustache logicless template is using the aggregated data (images) to build a simple gallery,
which uses jQuery’s lazy-loading, so only images within the close-range of the browser’s VIEWPORT will be fetched from 4Chan (saving their’s data plan).

this is mainly academic, since the 4Chan-API documentation is quite poorly explained..

JSON Usage Sample For Google-Maps API (Elevation And Geocode API)

geolocation

use either xml or json

http://maps.googleapis.com/maps/api/elevation/json?locations=32.333493,34.854604&sensor=true
{
   "results" : [
      {
         "elevation" : 38.73394393920898,
         "location" : {
            "lat" : 32.333493,
            "lng" : 34.854604
         },
         "resolution" : 610.8129272460938
      }
   ],
   "status" : "OK"
}

—————————-

http://maps.googleapis.com/maps/api/geocode/json?latlng=32.333493,34.854604&sensor=false

Continue reading

Protected: צבע אדום API

This content is password protected. To view it please enter your password below:

Enter your password to view comments.

.Net Easy File-Size Format Using API

here is a really nice way to skip all those custom-made functions that divides again and again the file size from bytes to get the human-readable file sizes:

C# example

[DllImport("Shlwapi.dll", CharSet = CharSet.Auto)]
public static extern long StrFormatByteSize( long fileSize, [MarshalAs(UnmanagedType.LPTStr)] StringBuilder buffer, int bufferSize );

public static string getPrettyFileSize (long lSize){
	StringBuilder sb = new StringBuilder( 12 );
	StrFormatByteSize( lSize, sb, sb.Capacity );
	return sb.ToString();
}

calling it will result with something like this:

VB6 API For CoInitializeEx and CoUninitialize of ole32.dll

Option Explicit
'Satisfying API For CoInitializeEx and CoUninitialize of ole32.dll
'Explained and MSDN referenced.
' Elad Karako

Private Enum COINIT_HRESULT
    S_OK = &H0&  'The COM library was initialized successfully on this thread.
    S_FALSE = &H1& 'The COM library is already initialized on this thread.
    RPC_E_CHANGED_MODE = &H80010106   'A previous call to CoInitializeEx specified the concurrency model for this thread as multithread apartment (MTA). This could also indicate that a change from neutral-threaded apartment to single-threaded apartment has occurred.
    E_INVALIDARG = &H80070057 'One or more arguments are invalid.
    E_OUTOFMEMORY = &H80000002 'Ran out of memory.
    E_UNEXPECTED = &H80041316 'The task XML contains an unexpected node.
End Enum

'COINIT Enumeration
'Determines the concurrency model used for incoming calls to objects created by this thread. This concurrency model can be either apartment-threaded or multi-threaded.
'see http://msdn.microsoft.com/en-us/library/ms678505(v=VS.85).aspx
'
'YOU SHOULD ONLY USE COINIT_APARTMENTTHREADED or COINIT_MULTITHREADED.
Private Enum COINIT
  COINIT_APARTMENTTHREADED = &H2 'Initializes the thread for apartment-threaded object concurrency.
  COINIT_MULTITHREADED = &H0 'Initializes the thread for multi-threaded object concurrency.
  COINIT_DISABLE_OLE1DDE = &H4 'Disables DDE for OLE1 support.
  COINIT_SPEED_OVER_MEMORY = &H8 'Trade memory for speed.
End Enum

'CoInitializeEx Function
'Initializes the COM library for use by the calling thread, sets the thread's concurrency model, and creates a new apartment for the thread if one is required.
'see http://msdn.microsoft.com/en-us/library/ms695279(v=VS.85).aspx
Private Declare Function CoInitializeEx Lib "ole32.dll" ( _
    ByVal pvReserved As Long, _
    ByVal dwCoInit As Long) As COINIT_HRESULT

'CoUninitialize Function
'Closes the COM library on the current thread, unloads all DLLs loaded by the thread, frees any other resources that the thread maintains, and forces all RPC connections on the thread to close.
'see http://msdn.microsoft.com/en-us/library/ms688715(v=VS.85).aspx
Private Declare Function CoUninitialize Lib "ole32.dll" ()


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


'CoInitializeEx Function
'Initializes the COM library for use by the calling thread, sets the thread's concurrency model, and creates a new apartment for the thread if one is required.
'see http://msdn.microsoft.com/en-us/library/ms695279(v=VS.85).aspx
Public Sub do_CoInitializeEx(Optional c As COINIT = COINIT_APARTMENTTHREADED, Optional bDebugResult As Boolean = False)
    Dim coihr As COINIT_HRESULT
    coihr = CoInitializeEx(ByVal 0&, c)
    If (bDebugResult) Then MsgBox toString(coihr)
    DoEvents
End Sub

'CoUninitialize Function
'Closes the COM library on the current thread, unloads all DLLs loaded by the thread, frees any other resources that the thread maintains, and forces all RPC connections on the thread to close.
'see http://msdn.microsoft.com/en-us/library/ms688715(v=VS.85).aspx
Public Sub do_CoUninitialize()
    CoUninitialize
    DoEvents
End Sub

'ment for debuging the result of CoInitializeEx Function,
'strings are from WinError.h and MSDN
Private Function toString(ByVal coihr As COINIT_HRESULT) As String
    If (coihr = HRESULT.S_OK) Then
        HRESULT_toString = "S_OK: The COM library was initialized successfully on this thread."
    ElseIf (coihr = HRESULT.S_FALSE) Then
        HRESULT_toString = "S_FALSE: The COM library is already initialized on this thread."
    ElseIf (coihr = HRESULT.RPC_E_CHANGED_MODE) Then
        HRESULT_toString = "RPC_E_CHANGED_MODE: A previous call to CoInitializeEx specified the concurrency model for this thread as multithread apartment (MTA). This could also indicate that a change from neutral-threaded apartment to single-threaded apartment has occurred."
    ElseIf (coihr = HRESULT.E_INVALIDARG) Then
        HRESULT_toString = "E_INVALIDARG: One or more arguments are invalid."
    ElseIf (coihr = HRESULT.E_OUTOFMEMORY) Then
        HRESULT_toString = "E_OUTOFMEMORY: Ran out of memory."
    ElseIf (coihr = HRESULT.E_UNEXPECTED) Then
        HRESULT_toString = "E_UNEXPECTED: The task XML contains an unexpected node."
    Else
        HRESULT_toString = CStr(coihr) & "(?) Unknown."
    End If
End Function